Functions

tensorrt.plugin.cdiv(first: int | ShapeExpr, second: int | ShapeExpr) ShapeExpr

Computes symbolic ceiling division of first by second

Parameters:
Raises:

ValueError – If both arguments are ints or if second evaluates to 0

Returns:

Symbolic expression for the ceiling division of first by second

Return type:

ShapeExpr

tensorrt.plugin.max(first: int | ShapeExpr, second: int | ShapeExpr) ShapeExpr

Computes the maximum of first and second

Parameters:
  • first (Union[int, ShapeExpr]) – First operand

  • second (Union[int, ShapeExpr]) – Second operand

Raises:

ValueError – If both arguments are ints

Returns:

Symbolic expression for the maximum of first and second

Return type:

ShapeExpr

tensorrt.plugin.min(first: int | ShapeExpr, second: int | ShapeExpr) ShapeExpr

Computes the minimum of first and second

Parameters:
  • first (Union[int, ShapeExpr]) – First operand

  • second (Union[int, ShapeExpr]) – Second operand

Raises:

ValueError – If both arguments are ints

Returns:

Symbolic expression for the minimum of first and second

Return type:

ShapeExpr

tensorrt.plugin.size_tensor(opt: ShapeExpr, upper_bound: ShapeExpr) SizeTensorDesc

Constructs a size tensor with the specified autotune shape expression opt and upper_bound

Parameters:
  • opt (ShapeExpr) – Symbolic expression for the extent of this size tensor to use in the autotune process of the engine build

  • upper_bound (ShapeExpr) – Symbolic expression for the upper-bound of this size tensor

Returns:

A tensor descriptor for a size tensor with the specified autotune extent and upper-bound

Return type:

SizeTensorDesc

tensorrt.plugin.from_shape_expr(shape_expr: Tuple[ShapeExpr | int] | ShapeExprs, dtype: DataType) TensorDesc

Constructs a tensor descriptor with the specified shape expression and data type

Parameters:
  • shape_expr (Union[Tuple[Union[ShapeExpr, int]], ShapeExprs]) – Expressions or constants denoting the shape of the tensor

  • dtype (trt.DataType) – Data type of the tensor

Returns:

Tensor descriptor with the specified shape expression and data type

Return type:

TensorDesc