Add interpolate_like function to oneflow.nn.functional#10644
Add interpolate_like function to oneflow.nn.functional#10644
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds a new interpolate_like utility to resize an input tensor to match the spatial dimensions of a reference tensor and exposes it in the functional API.
- Implements
interpolate_likeininterpolate.py, wrapping the existingInterpolatemodule. - Updates
functional/__init__.pyto exportinterpolate_like.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| python/oneflow/nn/modules/interpolate.py | Added interpolate_like function leveraging Interpolate(...).forward |
| python/oneflow/nn/functional/init.py | Imported and exposed interpolate_like in the functional namespace |
Comments suppressed due to low confidence (1)
python/oneflow/nn/modules/interpolate.py:313
- No unit tests were added for
interpolate_like. Consider adding tests covering different input ranks (3D, 4D, 5D) and modes to ensure correct behavior across all supported cases.
def interpolate_like(
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
Code got formatted by CI. Please request CI again if you still want to have this PR merged. If the PR is from a forked repo, please download the patch files from the GitHub Actions web page and apply them locally. |
|
View latest API docs preview at: https://oneflow-staging.oss-cn-beijing.aliyuncs.com/docs/Oneflow-Inc/oneflow/pr/10644/ |
Speed stats: |
|
View latest API docs preview at: https://oneflow-staging.oss-cn-beijing.aliyuncs.com/docs/Oneflow-Inc/oneflow/pr/10644/ |
Speed stats: |
This PR adds a new utility function interpolate_like to the oneflow.nn.functional module. It allows resizing an input tensor to match the spatial dimensions of a reference tensor using interpolation.
Changes: