Skip to content

Symbolic shapes ignored when exporting to ONNX with Torch backend #22076

@DLumi

Description

@DLumi

When trying to export model containing symbolic / non-fixed shapes, the exporter bakes in the lowest possible shape (i.e., 1).

Colab to reproduce:
https://colab.research.google.com/drive/1H81pAhOWr42YFnzrAT4zGI3XooXvM8oe

Suggestions:

  1. model.export() already supports **kwargs, and torch specifies dynamic_shapes / dynamic_axes for torch.onnx.export(), so just expose those, and it would work fine as is
  2. (better ux:) calculate dynamic_shapes / dynamic_axes automatically based off the input spec
  3. or all of the above

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions