IsSharedWith

Function Usage

Determines whether the current TensorData object shares a memory block with another object and uses the same memory management function.

Prototype

1
bool IsSharedWith(const TensorData &other) const

Parameters

Parameter

Input/Output

Description

other

Input

Another TensorData object

Returns

true indicates that two objects share the same memory and use the same memory management function. Otherwise, false is returned.

Constraints

None

Examples

1
2
3
4
auto addr = reinterpret_cast<void *>(0x10);
TensorData td1(addr, HostAddrManager, 100U, kOnHost);
TensorData td2(addr, HostAddrManager, 100U, kOnHost);
bool is_shared_td = td1.IsSharedWith(td2); // true