Class TensorRtHostMemory
- Namespace
- JYPPX.TensorRtSharp
- Assembly
- JYPPX.TensorRtSharp.dll
Managed wrapper around TensorRT host memory. TensorRT host memory 的托管封装。
public sealed class TensorRtHostMemory : IDisposable
- Inheritance
-
TensorRtHostMemory
- Implements
- Inherited Members
Properties
DataType
Gets the TensorRT data type reported for this host-memory block. 获取该 host-memory 内存块由 TensorRT 报告的数据类型。
public TensorRtDataType DataType { get; }
Property Value
Remarks
This metadata endpoint is available for TensorRT 8, TensorRT 10, and TensorRT 11 adapters. 当前该属性通过 TensorRT 11 适配器接入;TensorRT 8/10 适配线在补齐相同元数据端点前可能返回 NotSupported。
Line
Gets the TensorRT API line that produced this host memory. 获取生成当前 host memory 的 TensorRT API line。
public TensorRtApiLine Line { get; }
Property Value
SizeInBytes
Gets the serialized payload size in bytes. 获取序列化负载大小,单位为字节。
public ulong SizeInBytes { get; }
Property Value
Methods
Dispose()
Releases the TensorRT host-memory handle. 释放 TensorRT host memory 句柄。
public void Dispose()
SaveToFile(string)
Saves the TensorRT host-memory payload to a file. 将 TensorRT host memory 负载保存到文件。
public void SaveToFile(string filePath)
Parameters
filePathstringThe destination file path. 目标文件路径。
ToArray()
Copies the TensorRT host-memory payload into a managed byte array. 将 TensorRT host memory 负载复制到托管字节数组中。
public byte[] ToArray()
Returns
- byte[]
A managed byte-array copy of the payload. 负载的托管字节数组副本。