GetSize

Description

Obtains the memory size of the tensor data.

Prototype

size_t GetSize() const

Parameters

None

Returns

Memory size, in bytes

Restrictions

None

Example

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