昇腾社区首页
中文
注册

AllocTensorMsg

函数功能

根据shape、data type和对齐大小申请FlowMsg。

函数原型

1
FlowMsgPtr AllocTensorMsg(const std::vector<int64_t> &shape, DataType data_type, uint32_t align = 512U)

参数说明

参数名

输入/输出

描述

shape

输入

Tensor FlowMsg的shape。

data_type

输入

Tensor FlowMsg的DataType 。

align

输入

申请内存地址对齐大小,取值范围 【32、64、128、256、512、1024】,当前为预留参数。

返回值

申请的FlowMsg指针。

异常处理

申请不到FlowMsg指针则返回NULL。

约束说明

无。