Class TensorRtEngineInspector
- Namespace
- JYPPX.TensorRtSharp
- Assembly
- JYPPX.TensorRtSharp.dll
Managed wrapper around a TensorRT engine inspector. TensorRT engine inspector 的托管封装。
public sealed class TensorRtEngineInspector : IDisposable
- Inheritance
-
TensorRtEngineInspector
- Implements
- Inherited Members
Properties
HasErrorRecorder
Gets whether TensorRT reports an error recorder attached to this inspector. 获取 TensorRT 是否报告当前 inspector 绑定了 error recorder。
public bool HasErrorRecorder { get; }
Property Value
HasExecutionContext
Gets whether this inspector currently uses an execution context as the inspection source. 获取当前 inspector 是否已经关联 execution context 作为检查来源。
public bool HasExecutionContext { get; }
Property Value
Line
Gets the TensorRT API line used by this inspector. 获取当前 inspector 使用的 TensorRT API line。
public TensorRtApiLine Line { get; }
Property Value
Methods
ClearErrorRecorder()
Clears the error recorder attached to this engine inspector when the active TensorRT line supports it. 在当前 TensorRT 版本线支持时,清除绑定到该 engine inspector 的 error recorder。
public void ClearErrorRecorder()
Remarks
The managed wrapper does not expose user-owned TensorRT error-recorder callbacks yet; this method only clears a recorder TensorRT may report. 托管层目前尚未向普通用户暴露自定义 TensorRT error-recorder callback;该方法仅清理 TensorRT 报告的 recorder。
ClearExecutionContext()
Clears the execution context associated with this inspector. 清除当前 inspector 关联的 execution context。
public void ClearExecutionContext()
Dispose()
Releases the TensorRT engine-inspector handle. 释放 TensorRT engine inspector 句柄。
public void Dispose()
GetEngineInformation(TensorRtLayerInformationFormat)
Gets human-readable engine information from TensorRT. 从 TensorRT 获取可读的 engine 信息。
public string GetEngineInformation(TensorRtLayerInformationFormat format = TensorRtLayerInformationFormat.Oneline)
Parameters
formatTensorRtLayerInformationFormatThe layer information format. layer 信息格式。
Returns
- string
The engine information text. engine 信息文本。
GetLayerInformation(int, TensorRtLayerInformationFormat)
Gets layer information for a single TensorRT engine layer. 获取指定 TensorRT engine layer 的诊断信息。
public string GetLayerInformation(int layerIndex, TensorRtLayerInformationFormat format = TensorRtLayerInformationFormat.Oneline)
Parameters
layerIndexintZero-based layer index. / 从零开始的 layer 索引。
formatTensorRtLayerInformationFormatThe output format requested from TensorRT. / 向 TensorRT 请求的诊断信息格式。
Returns
- string
A copied UTF-8 string with TensorRT layer information. / 从 TensorRT 复制出的 UTF-8 layer 信息字符串。
SetExecutionContext(TensorRtExecutionContext)
Attaches an execution context to the inspector for context-aware reporting. 为 inspector 附加一个 execution context,以支持带上下文的信息输出。
public void SetExecutionContext(TensorRtExecutionContext context)
Parameters
contextTensorRtExecutionContextThe execution context to attach. 要附加的 execution context。