syft.generic.pointers.object_wrapper¶
Module Contents¶
-
class
syft.generic.pointers.object_wrapper.ObjectWrapper(obj, id: int, tags: List[str] = None, description: str = None)¶ A class that wraps an arbitrary object and provides it with an id, tags, and description
-
__call__(self, *args, **kwargs)¶
-
__str__(self)¶
-
__repr__(self)¶
-
property
obj(self)¶
-
static
create_pointer(object, owner: BaseWorker, location: BaseWorker, ptr_id: Union[int, str], id_at_location: Union[int, str] = None, garbage_collect_data=None, **kwargs)¶ Creates a callable pointer to the object wrapper instance
- Parameters
owner – A BaseWorker parameter to specify the worker on which the pointer is located. It is also where the pointer is registered if register is set to True.
location – The BaseWorker object which points to the worker on which this pointer’s object can be found. In nearly all cases, this is self.owner and so this attribute can usually be left blank. Very rarely you may know that you are about to move the Tensor to another worker so you can pre-initialize the location attribute of the pointer to some other worker, but this is a rare exception.
ptr_id – A string or integer parameter to specify the id of the pointer.
id_at_location – A string or integer id of the object being pointed to. Similar to location, this parameter is almost always self.id and so you can leave this parameter to None. The only exception is if you happen to know that the ID is going to be something different than self.id, but again this is very rare and most of the time, setting this means that you are probably doing something you shouldn’t.
garbage_collect_data – If True, delete the remote object when the pointer is deleted.
- Returns
A pointers.CallablePointer pointer to self.
-
static
simplify(worker: AbstractWorker, obj: ObjectWrapper)¶
-
static
detail(worker: AbstractWorker, obj_wrapper_tuple: str)¶
-