CastOp

公共类 CastOp

TensorBuffer 转换为指定的数据类型。

公共构造函数

CastOp(DataType destinationType)
构造 CastOp。

公共方法

TensorBuffer
applyTensorBuffer 输入)

继承的方法

公共构造函数

public CastOp (DataType destinationType)

构造 CastOp。

注意:如需仅针对实时(而不是在处理器中)特定 TensorBuffer 的转换类型,请直接使用 TensorBuffer.createFrom(TensorBuffer, DataType)

在执行此 Op 时,如果原始 TensorBuffer 已在 destinationType 中,系统将直接返回原始缓冲区。

参数
destinationType 转换后的 TensorBuffer 的类型。
抛出
IllegalArgumentException 如果 destinationType 既不是 DataType.UINT8,也不是 DataType.FLOAT32

公共方法

public TensorBuffer apply TensorBuffer 输入)

参数
输入