Class TensorRtEngineTensorBinding
- Namespace
- JYPPX.TensorRtSharp
- Assembly
- JYPPX.TensorRtSharp.dll
Describes one TensorRT engine I/O tensor for deployment binding diagnostics. 描述一个 TensorRT engine I/O tensor 的部署绑定诊断信息。
public sealed class TensorRtEngineTensorBinding
- Inheritance
-
TensorRtEngineTensorBinding
- Inherited Members
Constructors
TensorRtEngineTensorBinding(int, string, TensorRtDataType, TensorRtIOMode, TensorRtDims, TensorRtTensorLocation, bool, int, int, TensorRtTensorFormat, string, int, int, TensorRtDims?, TensorRtDims?, TensorRtDims?, IReadOnlyList<string>)
Creates a TensorRT engine tensor binding diagnostic snapshot. 创建 TensorRT engine tensor 绑定诊断快照。
public TensorRtEngineTensorBinding(int index, string name, TensorRtDataType dataType, TensorRtIOMode ioMode, TensorRtDims engineShape, TensorRtTensorLocation location, bool isShapeInferenceIO, int bytesPerComponent, int componentsPerElement, TensorRtTensorFormat format, string formatDescription, int vectorizedDimension, int profileIndex, TensorRtDims? profileMinShape, TensorRtDims? profileOptShape, TensorRtDims? profileMaxShape, IReadOnlyList<string> diagnostics)
Parameters
indexintnamestringdataTypeTensorRtDataTypeioModeTensorRtIOModeengineShapeTensorRtDimslocationTensorRtTensorLocationisShapeInferenceIOboolbytesPerComponentintcomponentsPerElementintformatTensorRtTensorFormatformatDescriptionstringvectorizedDimensionintprofileIndexintprofileMinShapeTensorRtDimsprofileOptShapeTensorRtDimsprofileMaxShapeTensorRtDimsdiagnosticsIReadOnlyList<string>
Properties
BytesPerComponent
Gets the number of bytes per scalar component for this tensor. 获取该 tensor 每个标量 component 的字节数。
public int BytesPerComponent { get; }
Property Value
ComponentsPerElement
Gets the number of scalar components per tensor element. 获取该 tensor 每个元素包含的 component 数量。
public int ComponentsPerElement { get; }
Property Value
DataType
Gets the TensorRT tensor data type. 获取 TensorRT tensor 数据类型。
public TensorRtDataType DataType { get; }
Property Value
Diagnostics
Gets non-fatal diagnostics collected while querying optional metadata. 获取查询可选元数据时收集到的非致命诊断信息。
public IReadOnlyList<string> Diagnostics { get; }
Property Value
EffectiveBytesPerComponent
Gets the usable bytes-per-component value, falling back to the scalar data type when older TensorRT lines do not expose optional format metadata. 获取可用的每 component 字节数;旧 TensorRT 版本未提供可选格式元数据时, 按标量数据类型安全回退。
public int EffectiveBytesPerComponent { get; }
Property Value
EffectiveComponentsPerElement
Gets the usable components-per-element value. Non-vectorized tensors fall back to one component when older TensorRT lines return zero for optional format metadata. 获取可用的每元素 component 数;旧 TensorRT 版本对可选格式元数据返回零时, 非向量化 tensor 安全回退为一个 component。
public int EffectiveComponentsPerElement { get; }
Property Value
EngineShape
Gets the static or profile-dependent shape recorded by the engine. 获取 engine 记录的静态或 profile 相关 shape。
public TensorRtDims EngineShape { get; }
Property Value
Format
Gets the TensorRT tensor format enum value. 获取 TensorRT tensor format 枚举值。
public TensorRtTensorFormat Format { get; }
Property Value
FormatDescription
Gets TensorRT's human-readable tensor format description. 获取 TensorRT 返回的可读 tensor format 描述。
public string FormatDescription { get; }
Property Value
IOMode
Gets whether this tensor is an input or output. 获取该 tensor 是输入还是输出。
public TensorRtIOMode IOMode { get; }
Property Value
Index
Gets the engine I/O tensor index. 获取 engine I/O tensor 索引。
public int Index { get; }
Property Value
IsShapeInferenceIO
Gets whether this tensor participates in TensorRT shape inference I/O. 获取该 tensor 是否参与 TensorRT shape inference I/O。
public bool IsShapeInferenceIO { get; }
Property Value
Location
Gets the expected TensorRT memory location for the tensor. 获取该 tensor 期望使用的 TensorRT 内存位置。
public TensorRtTensorLocation Location { get; }
Property Value
Name
Gets the TensorRT tensor name. 获取 TensorRT tensor 名称。
public string Name { get; }
Property Value
ProfileIndex
Gets the optimization profile index used for profile-specific metadata. 获取用于 profile 相关元数据查询的 optimization profile 索引。
public int ProfileIndex { get; }
Property Value
ProfileMaxShape
Gets the maximum profile shape when TensorRT exposes it for this tensor. 获取 TensorRT 能提供时该 tensor 的最大 profile shape。
public TensorRtDims? ProfileMaxShape { get; }
Property Value
ProfileMinShape
Gets the minimum profile shape when TensorRT exposes it for this tensor. 获取 TensorRT 能提供时该 tensor 的最小 profile shape。
public TensorRtDims? ProfileMinShape { get; }
Property Value
ProfileOptShape
Gets the optimum profile shape when TensorRT exposes it for this tensor. 获取 TensorRT 能提供时该 tensor 的最优 profile shape。
public TensorRtDims? ProfileOptShape { get; }
Property Value
UsesDataTypeSizeFallback
Gets whether byte-size estimation uses a data-type metadata fallback. 获取字节数估算是否使用了数据类型元数据回退。
public bool UsesDataTypeSizeFallback { get; }
Property Value
VectorizedDimension
Gets the vectorized dimension reported by TensorRT, or -1 when not vectorized. 获取 TensorRT 报告的 vectorized dimension;未向量化时通常为 -1。
public int VectorizedDimension { get; }
Property Value
Methods
EstimateByteSize(TensorRtDims)
Estimates the required byte count for a concrete runtime shape. 根据具体运行时 shape 估算该 tensor 需要的字节数。
public int EstimateByteSize(TensorRtDims runtimeShape)
Parameters
runtimeShapeTensorRtDimsThe concrete runtime shape. 具体运行时 shape。
Returns
- int
The estimated byte count. 估算字节数。