Skip to content

[Task]: Make Batch Dimension dynamic for ONNX export #2338

@Marcus1506

Description

@Marcus1506

What is the motivation for this task?

  1. Currently when specifying the input shape when using Engine.export to ONNX, the standard behavior is to fix the batch dimension. I don't think this reflects normal usecases for practitioner's really well and it is somewhat inconsistent for the following reason:
  2. When specifying no input shape, the batch size as well as height and width are treated as dynamic. I think when specifying input shape, it would make sense to have batch size dynamic, as there is currently no way of specifying a fixed batch size.

Describe the solution you'd like

  1. One solution would be to make batch size dynamic when specifying input shape in ExportMixin.to_onnx.
  2. Another solution, to perhaps also retain the functionality of fixed batch sizes, could be to add an additional argument to the export function.

Additional context

No response

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