Unverified Commit abc40ef2 authored by Kai Wana's avatar Kai Wana Committed by GitHub
Browse files

add comments for ops LastLevelMaxPool to avoid potential confusion (#7593)


Co-authored-by: default avatarNicolas Hug <contact@nicolas-hug.com>
parent 19b2d3ca
......@@ -206,7 +206,7 @@ class FeaturePyramidNetwork(nn.Module):
class LastLevelMaxPool(ExtraFPNBlock):
"""
Applies a max_pool2d on top of the last feature map
Applies a max_pool2d (not actual max_pool2d, we just subsample) on top of the last feature map
"""
def forward(
......@@ -216,7 +216,8 @@ class LastLevelMaxPool(ExtraFPNBlock):
names: List[str],
) -> Tuple[List[Tensor], List[str]]:
names.append("pool")
x.append(F.max_pool2d(x[-1], 1, 2, 0))
# Use max pooling to simulate stride 2 subsampling
x.append(F.max_pool2d(x[-1], kernel_size=1, stride=2, padding=0))
return x, names
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment