Table of Contents

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

index int
name string
dataType TensorRtDataType
ioMode TensorRtIOMode
engineShape TensorRtDims
location TensorRtTensorLocation
isShapeInferenceIO bool
bytesPerComponent int
componentsPerElement int
format TensorRtTensorFormat
formatDescription string
vectorizedDimension int
profileIndex int
profileMinShape TensorRtDims
profileOptShape TensorRtDims
profileMaxShape TensorRtDims
diagnostics IReadOnlyList<string>

Properties

BytesPerComponent

Gets the number of bytes per scalar component for this tensor. 获取该 tensor 每个标量 component 的字节数。

public int BytesPerComponent { get; }

Property Value

int

ComponentsPerElement

Gets the number of scalar components per tensor element. 获取该 tensor 每个元素包含的 component 数量。

public int ComponentsPerElement { get; }

Property Value

int

DataType

Gets the TensorRT tensor data type. 获取 TensorRT tensor 数据类型。

public TensorRtDataType DataType { get; }

Property Value

TensorRtDataType

Diagnostics

Gets non-fatal diagnostics collected while querying optional metadata. 获取查询可选元数据时收集到的非致命诊断信息。

public IReadOnlyList<string> Diagnostics { get; }

Property Value

IReadOnlyList<string>

EngineShape

Gets the static or profile-dependent shape recorded by the engine. 获取 engine 记录的静态或 profile 相关 shape。

public TensorRtDims EngineShape { get; }

Property Value

TensorRtDims

Format

Gets the TensorRT tensor format enum value. 获取 TensorRT tensor format 枚举值。

public TensorRtTensorFormat Format { get; }

Property Value

TensorRtTensorFormat

FormatDescription

Gets TensorRT's human-readable tensor format description. 获取 TensorRT 返回的可读 tensor format 描述。

public string FormatDescription { get; }

Property Value

string

IOMode

Gets whether this tensor is an input or output. 获取该 tensor 是输入还是输出。

public TensorRtIOMode IOMode { get; }

Property Value

TensorRtIOMode

Index

Gets the engine I/O tensor index. 获取 engine I/O tensor 索引。

public int Index { get; }

Property Value

int

IsShapeInferenceIO

Gets whether this tensor participates in TensorRT shape inference I/O. 获取该 tensor 是否参与 TensorRT shape inference I/O。

public bool IsShapeInferenceIO { get; }

Property Value

bool

Location

Gets the expected TensorRT memory location for the tensor. 获取该 tensor 期望使用的 TensorRT 内存位置。

public TensorRtTensorLocation Location { get; }

Property Value

TensorRtTensorLocation

Name

Gets the TensorRT tensor name. 获取 TensorRT tensor 名称。

public string Name { get; }

Property Value

string

ProfileIndex

Gets the optimization profile index used for profile-specific metadata. 获取用于 profile 相关元数据查询的 optimization profile 索引。

public int ProfileIndex { get; }

Property Value

int

ProfileMaxShape

Gets the maximum profile shape when TensorRT exposes it for this tensor. 获取 TensorRT 能提供时该 tensor 的最大 profile shape。

public TensorRtDims? ProfileMaxShape { get; }

Property Value

TensorRtDims

ProfileMinShape

Gets the minimum profile shape when TensorRT exposes it for this tensor. 获取 TensorRT 能提供时该 tensor 的最小 profile shape。

public TensorRtDims? ProfileMinShape { get; }

Property Value

TensorRtDims

ProfileOptShape

Gets the optimum profile shape when TensorRT exposes it for this tensor. 获取 TensorRT 能提供时该 tensor 的最优 profile shape。

public TensorRtDims? ProfileOptShape { get; }

Property Value

TensorRtDims

VectorizedDimension

Gets the vectorized dimension reported by TensorRT, or -1 when not vectorized. 获取 TensorRT 报告的 vectorized dimension;未向量化时通常为 -1。

public int VectorizedDimension { get; }

Property Value

int

Methods

EstimateByteSize(TensorRtDims)

Estimates the required byte count for a concrete runtime shape. 根据具体运行时 shape 估算该 tensor 需要的字节数。

public int EstimateByteSize(TensorRtDims runtimeShape)

Parameters

runtimeShape TensorRtDims

The concrete runtime shape. 具体运行时 shape。

Returns

int

The estimated byte count. 估算字节数。