syft.core.node.common.action.run_class_method_action

Classes

RunClassMethodAction(path, _self, args, ...)

When executing a RunClassMethodAction, a Node will run a method defined by the action's path attribute on the object pointed at by _self and keep the returned value in its store.

class syft.core.node.common.action.run_class_method_action.RunClassMethodAction(path, _self, args, kwargs, id_at_location, address, msg_id=None, is_static=False)[source]

Bases: syft.core.node.common.action.common.ImmediateActionWithoutReply

When executing a RunClassMethodAction, a Node will run a method defined by the action’s path attribute on the object pointed at by _self and keep the returned value in its store.

path

the dotted path to the method to call

_self

a pointer to the object which the method should be applied to.

args

args to pass to the function. They should be pointers to objects located on the Node that will execute the action.

kwargs

kwargs to pass to the function. They should be pointers to objects located on the Node that will execute the action.

static get_protobuf_schema()[source]

Return the type of protobuf object which stores a class of this type

As a part of serialization and deserialization, we need the ability to lookup the protobuf object type directly from the object type. This static method allows us to do this.

Importantly, this method is also used to create the reverse lookup ability within the metaclass of Serializable. In the metaclass, it calls this method and then it takes whatever type is returned from this method and adds an attribute to it with the type of this class attached to it. See the MetaSerializable class for details.

Returns

the type of protobuf object which corresponds to this class.

Return type

GeneratedProtocolMessageType

remap_input(current_input, new_input)[source]

Redefines some of the arguments, and possibly the _self of the function