Function Description
Enables the current TensorData object to share the memory and memory management function of another object.
Function Prototype
ge::graphStatus ShareFrom(const TensorData &other)
Parameters
| Parameter | Input/Output | Description |
| other | Input | Another TensorData object. |
Return Value
ge::GRAPH_SUCCESS on success.
Calling Example
std::vector<int> a = {10};
auto addr = reinterpret_cast<void *>(a.data());
TensorData td1(addr, HostAddrManager, 100U, kOnHost);
TensorData td2(addr, nullptr);
td2.ShareFrom(td1);