nvflare.app_common.decomposers.numpy_decomposers module¶
Decomposers for types from app_common and Machine Learning libraries.
- class Float32ScalarDecomposer[source]¶
Bases:
NumpyScalarDecomposer
- class Float64ScalarDecomposer[source]¶
Bases:
NumpyScalarDecomposer
- class Int32ScalarDecomposer[source]¶
Bases:
NumpyScalarDecomposer
- class Int64ScalarDecomposer[source]¶
Bases:
NumpyScalarDecomposer
- class NumpyArrayDecomposer[source]¶
Bases:
Decomposer
- decompose(target: ndarray, 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: Any, manager: DatumManager | None = None) ndarray [source]¶
Reconstruct the object from decomposed components.
- Parameters:
data – The decomposed component
manager – Datum manager to internalize datum
- Returns:
The reconstructed object
- class NumpyScalarDecomposer[source]¶
Bases:
Decomposer
,ABC
Decomposer base class for all numpy types with item method.
- decompose(target: Any, 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: Any, manager: DatumManager | None = None) ndarray [source]¶
Reconstruct the object from decomposed components.
- Parameters:
data – The decomposed component
manager – Datum manager to internalize datum
- Returns:
The reconstructed object