Skip to content

Default stride to kernel_size if not specified#162

Merged
mhs4670go merged 3 commits into
Samsung:mainfrom
mhs4670go:sup2
Jun 20, 2025
Merged

Default stride to kernel_size if not specified#162
mhs4670go merged 3 commits into
Samsung:mainfrom
mhs4670go:sup2

Conversation

@mhs4670go

Copy link
Copy Markdown
Contributor

This commit sets default stride to kernel_size when not provided.

stride of the pooling operation. Can be a single number or a tuple (sH, sW). Default: kernel_size

https://docs.pytorch.org/docs/stable/generated/torch.nn.functional.avg_pool2d.html

TICO-DCO-1.0-Signed-off-by: seongwoo mhs4670go@naver.com

This commit sets default stride to kernel_size when not provided.

TICO-DCO-1.0-Signed-off-by: seongwoo <mhs4670go@naver.com>
@mhs4670go mhs4670go requested a review from a team June 19, 2025 03:00
Comment on lines +75 to +76
if not stride:
stride = kernel_size

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

How about doing this in validate_args_kwargs? Defining proper __post_init__ could do.

@mhs4670go mhs4670go requested a review from dayo09 June 19, 2025 05:19
seockho-kim
seockho-kim previously approved these changes Jun 19, 2025

@seockho-kim seockho-kim left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM


def __post_init__(self):
assert len(self.kernel_size) == 2, len(self.kernel_size)
assert len(self.stride) == 2, len(self.stride)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This assert could be kept below Line 134

@dayo09 dayo09 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@Seunghui98 Seunghui98 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM!

@mhs4670go mhs4670go requested a review from seockho-kim June 19, 2025 06:51
@mhs4670go mhs4670go merged commit ed7d89e into Samsung:main Jun 20, 2025
5 checks passed
@mhs4670go mhs4670go deleted the sup2 branch June 20, 2025 05:30
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.

4 participants