Table of Contents

Class TensorRtOnnxConfig

Namespace
JYPPX.TensorRtSharp
Assembly
JYPPX.TensorRtSharp.dll

Managed wrapper around a TensorRT ONNX parser configuration. TensorRT ONNX parser 配置的托管封装。

public sealed class TensorRtOnnxConfig : IDisposable
Inheritance
TensorRtOnnxConfig
Implements
Inherited Members

Remarks

This wrapper owns the native ONNX config handle and exposes only copied scalar values. 当前封装拥有 native ONNX config 句柄,并且只暴露复制后的标量值。

Constructors

TensorRtOnnxConfig(TensorRtApiLine)

Creates a TensorRT ONNX parser configuration for the selected API line. 为指定 TensorRT API line 创建 ONNX parser 配置。

public TensorRtOnnxConfig(TensorRtApiLine line)

Parameters

line TensorRtApiLine

The TensorRT API line. TensorRT API 版本线。

Properties

FullTextFileName

Gets or sets the ONNX parser full text output file name. 获取或设置 ONNX parser full text 输出文件名。

public string FullTextFileName { get; set; }

Property Value

string

Remarks

This property stores metadata on the bridge-owned config. It does not expose native string pointers. 该属性只在 bridge-owned config 中保存元数据;不会暴露 native 字符串指针。

Line

Gets the TensorRT API line used by this ONNX config. 获取当前 ONNX config 使用的 TensorRT API 版本线。

public TensorRtApiLine Line { get; }

Property Value

TensorRtApiLine

ModelDataType

Gets or sets the model data type TensorRT should assume while parsing ONNX. 获取或设置 TensorRT 解析 ONNX 时采用的模型数据类型。

public TensorRtDataType ModelDataType { get; set; }

Property Value

TensorRtDataType

Remarks

TensorRT ONNX config accepts only Float, Half, and Int8 for this scalar setting. TensorRT ONNX config 的此标量设置仅接受 Float、Half 和 Int8。

ModelFileName

Gets or sets the ONNX model file name stored in this parser configuration. 获取或设置当前 parser 配置中保存的 ONNX model 文件名。

public string ModelFileName { get; set; }

Property Value

string

Remarks

The value is copied into a bridge-owned configuration object and copied back through a caller-provided buffer. 该值会复制到 bridge-owned 配置对象中,读取时通过调用方缓冲区复制回来。

PrintLayerInfo

Gets or sets whether TensorRT should print layer information while parsing. 获取或设置 TensorRT 解析时是否打印 layer 信息。

public bool PrintLayerInfo { get; set; }

Property Value

bool

TextFileName

Gets or sets the ONNX parser text output file name. 获取或设置 ONNX parser text 输出文件名。

public string TextFileName { get; set; }

Property Value

string

Remarks

This property stores metadata on the bridge-owned config. It does not open, create, or own the file. 该属性只在 bridge-owned config 中保存元数据;不会打开、创建或持有该文件。

VerbosityLevel

Gets or sets the ONNX parser verbosity level. 获取或设置 ONNX parser 日志详细级别。

public int VerbosityLevel { get; set; }

Property Value

int

Methods

DecreaseVerbosity()

Decreases the ONNX parser verbosity level by one without going below zero. 将 ONNX parser 日志详细级别降低一级,且不会降到零以下。

public void DecreaseVerbosity()

Dispose()

Releases the TensorRT ONNX config handle. 释放 TensorRT ONNX config 句柄。

public void Dispose()

IncreaseVerbosity()

Increases the ONNX parser verbosity level by one when the native config supports it. 在 native config 支持时将 ONNX parser 日志详细级别增加一级。

public void IncreaseVerbosity()

ToSnapshot()

Copies the current ONNX parser configuration into a pointer-free managed snapshot. 将当前 ONNX parser 配置复制为不含指针的托管快照。

public TensorRtOnnxConfigSnapshot ToSnapshot()

Returns

TensorRtOnnxConfigSnapshot

A copied ONNX config snapshot. 复制后的 ONNX config 快照。

Remarks

Strings are copied through caller-owned buffers by the native bridge before this snapshot is created. 字符串会先通过 native bridge 的调用方缓冲区复制回来,再进入该快照。