nvflare.app_common.decomposers.common_decomposers module

Decomposers for types from app_common and Machine Learning libraries.

class FLModelDecomposer[source]

Bases: Decomposer

decompose(b: FLModel, manager: DatumManager | None = None) Any[source]

Decompose the target into types supported by msgpack or classes with decomposers registered.

Msgpack supports primitives, bytes, memoryview, lists, dicts.

Parameters:
  • target – The instance to be serialized

  • manager – Datum manager to store externalized datum

Returns:

The decomposed serializable objects

recompose(data: tuple, manager: DatumManager | None = None) FLModel[source]

Reconstruct the object from decomposed components.

Parameters:
  • data – The decomposed component

  • manager – Datum manager to internalize datum

Returns:

The reconstructed object

supported_type()[source]

Returns the type/class supported by this decomposer.

Returns:

The class (not instance) of supported type

register()[source]