Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move pointwise_avg_3d into pointwise_avg #68

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

chAwater
Copy link
Contributor

Notes

  • [Why make this PR] At first, I just want the export function for PointwiseAvgPool, then I found the 3D and 2D are in separate files with similar codes, so I start to merge them
  • [How] I just copy-paste the code and remove duplicates, and made small modifications refer to pointwise_max.py
  • [Test] I run the tests with python -m unittest test/nn/test_pooling.py and python -m unittest test/nn/test_export.py
  • I'm not familiar with the Antialiased part, so I labeled it with review comment
  • This change might affect Give devs the flexibility to control PointwiseAvgPoolAntialiased2D output #36
  • Sorry that my IDE automatically removed whitespace in blank lines, I hope this is ok

Contents

  • Move pointwise_avg_3d.py into pointwise_avg.py - 388af7f
  • Add export (with tests) for PointwiseAvgPool2D and PointwiseAvgPool3D - 71967fa, 630de18
  • Fix missing ceil_mode in export of PointwiseMaxPool2D and PointwiseMaxPool3D - 655a059

Signed-off-by: chenhe <chenhe@megarobo.tech>
Signed-off-by: chenhe <chenhe@megarobo.tech>
Signed-off-by: chenhe <chenhe@megarobo.tech>
Signed-off-by: chenhe <chenhe@megarobo.tech>
Comment on lines 265 to +275
filter_size = 2*int(round(3*sigma))+1

self.kernel_size = (filter_size, filter_size)

if isinstance(stride, int):
self.stride = (stride, stride)
elif stride is None:
self.stride = self.kernel_size
else:
self.stride = stride

if stride is None:
stride = filter_size

if padding is None:
padding = int((filter_size-1)//2)

if isinstance(padding, int):
self.padding = (padding, padding)
else:
self.padding = padding

# Build the Gaussian smoothing filter
super(_PointwiseAvgPoolAntialiasedND, self).__init__(
in_type, d, filter_size, stride, padding
)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not familiar with the Antialiased part, especially the kernel_size you have mentioned in #36 (comment)
So I'm not sure this modification is compatible with your later plan for implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant