InputInfo¶
- class nvtripy.InputInfo(shape: Sequence[int | DimensionSize | Tuple[int | DimensionSize, int | DimensionSize, int | DimensionSize]], dtype: dtype)[source]¶
Bases:
object
Captures information about an input to a compiled function.
- Parameters:
shape (Sequence[int | DimensionSize | Tuple[int | DimensionSize, int | DimensionSize, int | DimensionSize]]) – The shape of the input. To indicate dynamic dimensions, provide the minimum, optimum, and maximum values for the dimension.
dtype (dtype) – The data type of the input.
Example
1inp = tp.InputInfo((2, 4), dtype=tp.float32)
>>> inp InputInfo(min=[2, 4], opt=[2, 4], max=[2, 4], dtype=float32)
Example: Dynamic Dimensions
1# The first dimension will support values in the range [1, 3], 2# optimizing for a size of 2. 3inp = tp.InputInfo(((1, 2, 3), 4), dtype=tp.float32)
>>> inp InputInfo(min=[1, 4], opt=[2, 4], max=[3, 4], dtype=float32)