目录

SetSize

Function Description

Sets the memory size of a tensor.

Function Prototype

void SetSize(const size_t size)

Parameters

Parameter Input/Output Description
size Input Memory size of a tensor, in bytes.

Return Value

None

Restrictions

None

Calling Example

StorageShape sh({1, 2, 3}, {1, 2, 3});
Tensor t = {sh, {}, {}, ge::DT_FLOAT, nullptr};
t.SetSize(0U);