Functions#

tensorrt.plugin.cdiv(first: Union[int, tensorrt.plugin._tensor.ShapeExpr], second: Union[int, tensorrt.plugin._tensor.ShapeExpr]) tensorrt.plugin._tensor.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: Union[int, tensorrt.plugin._tensor.ShapeExpr], second: Union[int, tensorrt.plugin._tensor.ShapeExpr]) tensorrt.plugin._tensor.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: Union[int, tensorrt.plugin._tensor.ShapeExpr], second: Union[int, tensorrt.plugin._tensor.ShapeExpr]) tensorrt.plugin._tensor.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: tensorrt.plugin._tensor.ShapeExpr, upper_bound: tensorrt.plugin._tensor.ShapeExpr) tensorrt.plugin._tensor.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: Union[Tuple[Union[tensorrt.plugin._tensor.ShapeExpr, int]], tensorrt.plugin._tensor.ShapeExprs], dtype: tensorrt.tensorrt.DataType) tensorrt.plugin._tensor.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