昇腾社区首页
中文
注册
开发者
下载

InputTensorDesc

函数功能

设置输入Tensor的描述信息,用于构造InferDataTypeContext的基类ExtendedKernelContext中的ComputeNodeInfo信息。

函数原型

1
OpInferDataTypeContextBuilder &InputTensorDesc(size_t index, ge::DataType dtype, ge::Format origin_format, ge::Format storage_format, const gert::ExpandDimsType &expand_dims_type = {})

参数说明

参数

输入/输出

说明

index

输入

算子输入实例索引。

dtype

输入

输入Tensor的数据类型。

origin_format

输入

输入Tensor的原始格式。

storage_format

输入

输入Tensor的存储格式。

expand_dims_type

输入

输入Tensor的补维规则ExpandDimsType,默认值为{}。

返回值说明

OpInferDataTypeContextBuilder对象引用,用于链式调用。

约束说明

在调用Build方法之前,必须调用该接口,否则构造出的InferDataTypeContext将包含未定义数据。