目录

SetSize

Function Description

Sets the memory size of the tensor data.

Function Prototype

void SetSize(const size_t size)

Parameters

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

Return Value

None

Restrictions

None

Calling Example

std::vector<int> a = {10};
auto addr = reinterpret_cast<void *>(a.data());
TensorData td(addr, HostAddrManager, 100U, kOnHost);
td.SetSize(10U);