Skip to main content

GetDataType

GetShape​

函数功能​

用于获取Tensor的形状。

函数原型​

std::vector<uint32_t> GetShape() const;

返回参数说明​

数据结构说明
std::vector<uint32_t>shape数组。

父主题: TensorBase

GetStrides​

函数功能​

用于获取Tensor的步长。

函数原型​

std::vector<uint32_t> GetStrides() const;

返回参数说明​

参数名说明
std::vector<uint32_t>Tensor的步长数组。

父主题: TensorBase

GetDeviceId​

函数功能​

用于获取Tensor的设备号。

函数原型​

int32_t GetDeviceId() const;

返回参数说明​

数据结构说明
tensor返回设备号,是一个int类型。

父主题: TensorBase

GetDataType​

函数功能​

用于获取内存中张量的数据类型。

函数原型​

TensorDataType GetDataType() const;

返回参数说明​

数据结构说明
TensorDataType请参考TensorDataType枚举说明。

父主题: TensorBase

GetDataTypeSize​

函数功能​

用于获取Tensor的数据类型。根据TensorDataType的具体类型返回该类型字节长度。

函数原型​

uint32_t GetDataTypeSize() const;

返回参数说明​

数据结构说明
uint32_tTensor的数据类型对应的字节长度。

父主题: TensorBase

IsHost​

函数功能​

用于判断Tensor对象是否在Host侧。

函数原型​

bool IsHost() const;

返回参数说明​

数据结构说明
bool- true:在Host侧。
- false:不在Host侧。

父主题: TensorBase

IsDevice​

函数功能​

用于判断Tensor对象是否在Device侧。

函数原型​

bool IsDevice() const;

返回参数说明​

数据结构说明
bool- true:在Device侧。
- false:不在Device侧。

父主题: TensorBase

在线提单