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

Support for GridSample Operation #2374

Open
eewindfly opened this issue Dec 23, 2024 · 0 comments
Open

Support for GridSample Operation #2374

eewindfly opened this issue Dec 23, 2024 · 0 comments
Labels
unsupported ops Issues related to unsupported operators

Comments

@eewindfly
Copy link

eewindfly commented Dec 23, 2024

New Operator

GridSample

Describe the operator

GridSample is a widely used operator in PyTorch for spatial transformation and grid sampling tasks. It allows sampling and interpolation of grid points, which is essential for operations such as spatial transformers, image warping, and more.

Adding support for GridSample in tf2onnx would enable seamless conversion of PyTorch models that rely on this functionality, particularly for vision-related tasks.

Do you know this operator can be constructed using existing ONNX operators?

Yes, it appears that TensorFlow Graphics provides a similar operation via tfg.image.transformer.sample. It might be possible to map GridSample to this operation during the conversion process.

Is this operator used by any model currently? Which one?

Yes, GridSample is commonly used in many vision models, including:
• Spatial Transformer Networks
• GANs that perform image alignment or transformation
• Optical flow estimation models

Notes

Adding this operator would enhance the compatibility of PyTorch models with TensorFlow/ONNX ecosystems.
TensorFlow Graphics documentation: tfg.image.transformer.sample

@eewindfly eewindfly added the unsupported ops Issues related to unsupported operators label Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
unsupported ops Issues related to unsupported operators
Projects
None yet
Development

No branches or pull requests

1 participant