(beta)at_npu::native::get_npu_format
定义文件
torch_npu\csrc\core\npu\NPUFormat.h
接口原型
int64_t at_npu::native::get_npu_format(const at::Tensor& self)
功能描述
获取npu tensor格式信息,返回值类型int64_t,表示获取的npu tensor格式信息。

该接口通常配合申请npu私有格式内存empty_with_format使用。
参数说明
self:Tensor类型,待获取格式信息的tensor。
支持的型号
- Atlas 训练系列产品
- Atlas A2 训练系列产品
- Atlas 推理系列产品
父主题: C++ API