TensorRT Dynamic Shape

https://docs.nvidia.com/deeplearning/tensorrt/latest/inference-library/work-dynamic-shapes.html

The following sections provide greater detail; however, here is an overview of the steps for building an engine with dynamic shapes:

  • Specify each runtime dimension of an input tensor by using -1 as a placeholder for the dimension.
  • Specify one or more optimization profiles at build time that specify the permitted range of dimensions for inputs with runtime dimensions and the dimensions for which the auto-tuner will optimize. For more information, refer to the Optimization Profiles section.