On torch.onnx.export()

I need some help on parameters of torch.onnx.export(…)

1, dynamic axes.what are backgrounds or application requirements for us to set dynamic axes?

dynamic_axes can be used to specify dimensions with a dynamic shape (i.e. the shape is known at runtime and can change). Usually dynamic shapes are used in a temporal dimension or spatial dimensions.

I’m still not very clear, take temporal as example, if we take time as a dimension of input ,we can write the input tensor as

input_image = [W H T]

where W is width, H is height, T is temporal

dimension of input_image is 3(fixed), the value of T is changed at every frame, in this example ,we should set T as dynamic axis?

What I understand about dynamic shape is changing of dimensions, not value of a specified dimension, e.g.,

at frame 1: input_image = [W H T]
at frame 2: input_image =[W H]

this is called dynamic shape of input, right?

No, usually you refer to a change in the actual shape. I.e. in one iteration the input shape could be [1, 1, 1] in the next it could be [2, 3, 4].
Dropping or adding an entire dimension would usually just fail at a layer input as a specific number of dimensions is expected.

Now I get the point, thanks a lot