KEMBAR78
affine_grid and grid_sample operators merge/accelleration · Issue #104296 · pytorch/pytorch · GitHub
Skip to content

affine_grid and grid_sample operators merge/accelleration #104296

@g-moschetti

Description

@g-moschetti

🚀 The feature, motivation and pitch

Hi,

To warp some data according to a (batch) of affine transformations, two functions called sequentially need to be used:

  1. affine_grid to calculate the transformed coordinates followed by
  2. warp_sample to do the actual warping.

Would it make sense to have also the option of a function that does the two operation in a single pass rather than having to call the two sequentially?
The advantage would be only for speed: warping according to an affinity transformation would avoid to store the result of affine_grid (shape (N,H,W,2) for a spatial warp), but the transformed coordinates could be calculated locally and then used immediately to warp the input data.

I am exploring the possibility of working on the topic and wanted to know if a contribution in this direction could be useful.
Thanks in advance for your feedback

Alternatives

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureA request for a proper, new feature.module: performanceIssues related to performance, either of kernel code or framework gluetriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions