can be safely exported without the torchscript flag.
Dummy inputs and standard lengths
The dummy inputs are used to do a model forward pass. While the inputs' values are propagating through the layers,
Pytorch keeps track of the different operations executed on each tensor. These recorded operations are then used to
create the "trace" of the model.
The trace is created relatively to the inputs' dimensions. It is therefore constrained by the dimensions of the dummy
input, and will not work for any other sequence length or batch size. When trying with a different size, an error such
as:
The expanded size of the tensor (3) must match the existing size (7) at non-singleton dimension 2
will be raised. It is therefore recommended to trace the model with a dummy input size at least as large as the largest
