函数¶
- tensorrt.plugin.cdiv(first: int | ShapeExpr, second: int | ShapeExpr) ShapeExpr ¶
计算 first 除以 second 的符号上限除法
- tensorrt.plugin.max(first: int | ShapeExpr, second: int | ShapeExpr) ShapeExpr ¶
计算 first 和 second 的最大值
- tensorrt.plugin.min(first: int | ShapeExpr, second: int | ShapeExpr) ShapeExpr ¶
计算 first 和 second 的最小值
- tensorrt.plugin.size_tensor(opt: ShapeExpr, upper_bound: ShapeExpr) SizeTensorDesc ¶
使用指定的自动调优形状表达式 opt 和 upper_bound 构造大小张量
- 参数:
- 返回:
具有指定自动调优范围和上限的大小张量的张量描述符
- 返回类型:
- tensorrt.plugin.from_shape_expr(shape_expr: Tuple[ShapeExpr | int] | ShapeExprs, dtype: DataType) TensorDesc ¶
使用指定的形状表达式和数据类型构造张量描述符
- 参数:
shape_expr (Union[Tuple[Union[ShapeExpr, int]], ShapeExprs]) – 表示张量形状的表达式或常量
dtype (trt.DataType) – 张量的数据类型
- 返回:
具有指定形状表达式和数据类型的张量描述符
- 返回类型: