syft.core.plan.plan

This is the main Plan class which is responsible for containing a list of Actions which can be serialized, deserialized, and executed by substituting the run time pointers with the original traced pointers and replaying the actions against a node.

Classes

Plan([actions, inputs, outputs, i2o_map, ...])

A plan is a collection of actions, plus some variable inputs, that together form a computation graph.

class syft.core.plan.plan.Plan(actions=None, inputs=None, outputs=None, i2o_map=None, code=None, max_calls=None)[source]

Bases: syft.core.common.serde.serializable.Serializable

A plan is a collection of actions, plus some variable inputs, that together form a computation graph.

actions

list of actions

inputs

Pointers to the inputs. Defaults to None.

__init__(actions=None, inputs=None, outputs=None, i2o_map=None, code=None, max_calls=None)[source]

Initialize the Plan with actions, inputs and outputs

execute_locally(**kwargs)[source]

Execute a plan by sending it to a virtual machine and calling execute on the pointer. This is a workaround until we have a way to execute plans locally.

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