类说明

Tensor数据类,作为模型推理的输入与输出的数据结构。

Tensor类涉及申请Device侧资源,与MxDeInit的作用域冲突,因此,其作用域不能大于或等于MxDeInit的作用域。

支持的型号

接口的硬件支持情况如表1所示,标识的含义如下:
  • √:支持
  • x:不支持
表1 接口的硬件支持情况

接口

Atlas 200I/500 A2 推理产品

Atlas 推理系列产品

Atlas 800I A2推理产品

Atlas 200/300/500 推理产品

Tensor

~Tensor

operator =

x

operator ==

x

GetData

SetShape

x

GetShape

GetDataType

GetMemoryType

x

GetByteSize

GetDeviceId

ToDevice

ToHost

ToDvpp

x

IsEmpty

x

TensorFree

x

IsWithMargin

x

SetValidRoi

x

GetValidRoi

x

TensorMalloc

BatchConcat

Transpose

x

Clone

x

SetTensorValue

x

SetReferRect

x

GetReferRect

x