InputInfo

class tripy.InputInfo(shape: Sequence[int | Tuple[int, int, int]], dtype: dtype)[source]

Bases: object

Captures information about an input to a compiled function.

Parameters:
  • shape (Sequence[int | Tuple[int, int, int]]) – 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
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
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)