Skip to content

Need to define the algorithm for the calculation of the output shape of Resample2d #360

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

Closed
lisa0314 opened this issue Mar 7, 2023 · 2 comments

Comments

@lisa0314
Copy link

lisa0314 commented Mar 7, 2023

As the spec said, when the target sizes are not specified, the output sizes should be calculated from the options.scales argument.
However, the calculation formula of the output shape is missing currently.
For example,
output_shape[axes[i]] = floor(scales[i] * (input_shape[axes[i]]) for all i in axes
output_shape[j] = input_shape[j] for j not in axes, j in range(0, input_rank)

This issue was raised by @huningxin in WebNN Chromium CL review. Thanks Ningxin!

@fdwr
Copy link
Collaborator

fdwr commented Apr 14, 2023

floor sounds good to me, to avoid partial pixels, and it's evidently also what the preliminary Chromium implementation is already doing in resample.

@BruceDai
Copy link
Contributor

Thanks @inexorabletash's reminder comment on #611.

Also this is mentioned in #360 so I think after this lands we can close that issue?

Now I think we may close this one, thanks.

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

No branches or pull requests

5 participants