ShareFrom

Function Usage

Enables the current TensorData object to share the memory and memory management function of another object.

Prototype

1
ge::graphStatus ShareFrom(const TensorData &other)

Parameters

Parameter

Input/Output

Description

other

Input

Another TensorData object

Returns

If the operation is successful, ge::GRAPH_SUCCESS is returned.

Constraints

None

Examples

1
2
3
4
auto addr = reinterpret_cast<void *>(0x10);
TensorData td1(addr, HostAddrManager, 100U, kOnHost);
TensorData td2(addr, nullptr);
td2.ShareFrom(td1);