NamedDimension

class nvtripy.NamedDimension(name: str, min: int, opt: int, max: int)[source]

Bases: object

Represents a named dimension with its shape bounds.

Two dimensions with the same name must be equal at runtime. This equality can be exploited by the compiler to achieve better optimizations.

Parameters:
  • name (str) – The name of the dimension.

  • min (int) – The minimum size of the dimension.

  • opt (int) – The size of the dimension for which the compiler should optimize.

  • max (int) – The maximum size of the dimension.

Example: Creating a Named Dimension
1batch = tp.NamedDimension("batch", 1, 2, 3)
Local Variables
>>> batch
NamedDimension<name: 'batch', bounds: (1, 2, 3)>