syft.messaging.plan.state

Module Contents

class syft.messaging.plan.state.State(owner, state_placeholders=None)

Bases: object

The State is a Plan attribute and is used to send tensors along functions.

It references Plan tensor or parameters attributes using their name, and make sure they are provided to remote workers who are sent the Plan.

__str__(self)

Returns the string representation of the State.

__repr__(self)
tensors(self)

Fetch and return all the state elements.

copy(self)
read(self)

Return state tensors that are from this plan specifically, but not those of plans including in this plan. If run while a plan is building, declare all the state tensors to the plan currently building.

static create_grad_if_missing(tensor)
fix_precision_(self, *args, **kwargs)
float_precision_(self)
share_(self, *args, **kwargs)
get_(self)

Get functionality that can only be used when getting back state elements converted to additive shared tensors. Other than this, you shouldn’t need to the get the state separately.

static simplify(worker: AbstractWorker, state: State)

Simplify the plan’s state when sending a plan

static detail(worker: AbstractWorker, state_tuple: tuple)

Reconstruct the plan’s state from the state elements and supposed ids.

static bufferize(worker: AbstractWorker, state: State)

Serialize the State to Protobuf message

static unbufferize(worker: AbstractWorker, protobuf_state: StatePB)

Reconstruct the plan’s state from the state elements and supposed ids.