Class TensorRtWeights
- Namespace
- JYPPX.TensorRtSharp
- Assembly
- JYPPX.TensorRtSharp.dll
Immutable TensorRT weights payload for layer creation APIs. 用于 layer 创建 API 的不可变 TensorRT weights 负载。
public sealed class TensorRtWeights
- Inheritance
-
TensorRtWeights
- Inherited Members
Properties
DataType
Gets the TensorRT data type carried by the weights payload. 获取当前 weights 负载携带的 TensorRT 数据类型。
public TensorRtDataType DataType { get; }
Property Value
ElementCount
Gets the logical element count. 获取逻辑元素数量。
public int ElementCount { get; }
Property Value
Methods
Empty(TensorRtDataType)
Creates an empty weights payload for the requested TensorRT data type. 为指定 TensorRT 数据类型创建一个空的 weights 负载。
public static TensorRtWeights Empty(TensorRtDataType dataType = TensorRtDataType.Float)
Parameters
dataTypeTensorRtDataTypeThe TensorRT data type. TensorRT 数据类型。
Returns
- TensorRtWeights
An empty weights payload. 空的 weights 负载。
FromBooleanArray(bool[])
Creates boolean weights from a managed boolean array. 从托管布尔数组创建 boolean weights。
public static TensorRtWeights FromBooleanArray(bool[] values)
Parameters
valuesbool[]The source boolean values. 源布尔值数组。
Returns
- TensorRtWeights
A TensorRT weights payload. TensorRT weights 负载。
FromByteArray(byte[], TensorRtDataType)
Creates byte-backed weights from a managed byte array. 从托管字节数组创建 byte-backed weights。
public static TensorRtWeights FromByteArray(byte[] values, TensorRtDataType dataType = TensorRtDataType.Int8)
Parameters
valuesbyte[]The source byte values. 源字节值数组。
dataTypeTensorRtDataTypeThe TensorRT byte-compatible data type. 兼容字节表示的 TensorRT 数据类型。
Returns
- TensorRtWeights
A TensorRT weights payload. TensorRT weights 负载。
FromInt32Array(int[])
Creates INT32 weights from a managed integer array. 从托管整数数组创建 INT32 weights。
public static TensorRtWeights FromInt32Array(int[] values)
Parameters
valuesint[]The source integer values. 源整数值数组。
Returns
- TensorRtWeights
A TensorRT weights payload. TensorRT weights 负载。
FromSingleArray(float[])
Creates float weights from a managed single-precision array. 从托管单精度数组创建 float weights。
public static TensorRtWeights FromSingleArray(float[] values)
Parameters
valuesfloat[]The source float values. 源浮点值数组。
Returns
- TensorRtWeights
A TensorRT weights payload. TensorRT weights 负载。