SetSize
Description
Sets the memory size of a tensor.
Prototype
void SetSize(const size_t size)
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
size |
Input |
Memory size of a tensor, in bytes. |
Returns
None
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};
t.SetSize(0U);
Parent topic: Tensor