syft.serde.protobuf.native_serde

This file exists to provide a common place for all Protobuf serialisation for native Python objects. If you’re adding something here that isn’t for None, think twice and either use an existing sub-class of Message or add a new one.

Module Contents

syft.serde.protobuf.native_serde._bufferize_none(worker: AbstractWorker, obj: type(None)) → 'Empty'

This function converts None into an empty Protobuf message.

Parameters

obj (None) – makes signature match other bufferize methods

Returns

Empty Protobuf message

Return type

protobuf_obj

syft.serde.protobuf.native_serde._unbufferize_none(worker: AbstractWorker, obj: Empty) → 'type(None)'

This function converts an empty Protobuf message back into None.

Parameters

obj (Empty) – Empty Protobuf message

Returns

None

Return type

obj

syft.serde.protobuf.native_serde.MAP_NATIVE_PROTOBUF_TRANSLATORS