MCPcopy Create free account
hub / github.com/OpenMined/SyMPC / ispointer

Function ispointer

src/sympc/utils/utils.py:19–30  ·  view source on GitHub ↗

Check if a given obj is a pointer (is a remote object). Args: obj (Any): Object. Returns: bool: True (if pointer) or False (if not).

(obj: Any)

Source from the content-addressed store, hash-verified

17
18
19def ispointer(obj: Any) -> bool:
20 """Check if a given obj is a pointer (is a remote object).
21
22 Args:
23 obj (Any): Object.
24
25 Returns:
26 bool: True (if pointer) or False (if not).
27 """
28 if type(obj).__name__.endswith("Pointer") and hasattr(obj, "id_at_location"):
29 return True
30 return False
31
32
33def islocal(obj: Any) -> bool:

Callers 7

share_state_dictMethod · 0.90
share_state_dictMethod · 0.90
_request_and_getMethod · 0.90
_request_and_getMethod · 0.90
__init__Method · 0.90
sanity_checksMethod · 0.90
test_share_tensorFunction · 0.90

Calls

no outgoing calls

Tested by 1

test_share_tensorFunction · 0.72