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

spatial resample -- adaptive padding mode when switching the backends #6222

Closed
wyli opened this issue Mar 22, 2023 · 1 comment · Fixed by #6429
Closed

spatial resample -- adaptive padding mode when switching the backends #6222

wyli opened this issue Mar 22, 2023 · 1 comment · Fixed by #6429

Comments

@wyli
Copy link
Contributor

wyli commented Mar 22, 2023

for the array pad functions there's numpy->torch mode str adaptation

def _convert_pt_pad_mode(padding_mode):
"""get the most similar mode of `pad` from ``padding_mode`` of the spatial resampling."""
if padding_mode is None or padding_mode in ("zeros", "constant", "grid-constant"):

would be great to implement the same idea for spatial resampling

def resolve_modes(interp_mode, padding_mode):
"""compute the backend and the corresponding mode for the given interpolation mode and padding mode."""
_interp_mode = None
_padding_mode = None

@atbenmurray
Copy link
Contributor

atbenmurray commented Mar 22, 2023

@wyli This is the second PR I want to make to #5860

It should be ready later today. It is a bit more involved than just this because whether you can map or not is also dependent on the way that you are going to resample.

@atbenmurray atbenmurray self-assigned this Mar 22, 2023
wyli added a commit that referenced this issue Apr 26, 2023
Fixes #6222

### Description
nonbreaking change extending the current mode+padding mode combinations.

### Types of changes
<!--- Put an `x` in all the boxes that apply, and remove the not
applicable items -->
- [x] Non-breaking change (fix or new feature that would not break
existing functionality).
- [ ] Breaking change (fix or new feature that would cause existing
functionality to change).
- [ ] New tests added to cover the changes.
- [ ] Integration tests passed locally by running `./runtests.sh -f -u
--net --coverage`.
- [ ] Quick tests passed locally by running `./runtests.sh --quick
--unittests --disttests`.
- [ ] In-line docstrings updated.
- [ ] Documentation updated, tested `make html` command in the `docs/`
folder.

---------

Signed-off-by: Wenqi Li <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants