目录

GetSize

Function Description

Obtains the memory size of the tensor data.

Function Prototype

size_t GetSize() const

Parameters

None

Return Value

Memory size, in bytes.

Restrictions

None

Calling Example

StorageShape sh({1, 2, 3}, {1, 2, 3});
Tensor t = {sh, {}, {}, ge::DT_FLOAT, nullptr};
auto td_size = t.GetSize(); // 1*2*3*sizeof(float) = 24;