跳到主要内容

构造函数和析构函数

函数功能

TensorDesc构造函数和析构函数。

函数原型

TensorDesc();
~TensorDesc() = default;
explicit TensorDesc(Shape shape, Format format = FORMAT_ND, DataType dt = DT_FLOAT);
TensorDesc(const TensorDesc &desc);
TensorDesc(TensorDesc &&desc);
TensorDesc &operator=(const TensorDesc &desc);
TensorDesc &operator=(TensorDesc &&desc);

参数说明

参数名输入/输出描述
shape输入Shape对象。
format输入Format对象,默认取值FORMAT_ND。 关于Format数据类型的定义,请参见Format
dt输入DataType对象,默认取值DT_FLOAT。 关于DataType数据类型的定义,请参见DataType
desc输入待拷贝或者移动的TensorDesc对象。

返回值

TensorDesc构造函数返回TensorDesc类型的对象。

异常处理

约束说明