flwr-nightly 1.7.0.dev20240124__tar.gz → 1.7.0.dev20240126__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/PKG-INFO +2 -1
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/README.md +1 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/pyproject.toml +2 -2
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/client/app.py +5 -5
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/client/client.py +8 -8
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/client/flower.py +3 -3
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/client/message_handler/message_handler.py +15 -15
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/client/node_state.py +16 -15
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/client/node_state_tests.py +18 -13
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/client/numpy_client.py +16 -16
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/client/typing.py +3 -3
- flwr_nightly-1.7.0.dev20240124/src/py/flwr/client/run_state.py → flwr_nightly-1.7.0.dev20240126/src/py/flwr/common/context.py +19 -6
- flwr_nightly-1.7.0.dev20240124/src/py/flwr/common/flowercontext.py → flwr_nightly-1.7.0.dev20240126/src/py/flwr/common/message.py +6 -19
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/common/recordset_compat.py +22 -14
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/common/serde.py +79 -7
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/simulation/ray_transport/ray_actor.py +19 -19
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/simulation/ray_transport/ray_client_proxy.py +4 -4
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/LICENSE +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/__init__.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/client/__init__.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/client/dpfedavg_numpy_client.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/client/grpc_client/__init__.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/client/grpc_client/connection.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/client/grpc_rere_client/__init__.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/client/grpc_rere_client/connection.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/client/message_handler/__init__.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/client/message_handler/task_handler.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/client/middleware/__init__.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/client/middleware/utils.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/client/rest_client/__init__.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/client/rest_client/connection.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/client/secure_aggregation/__init__.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/client/secure_aggregation/handler.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/client/secure_aggregation/secaggplus_handler.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/common/__init__.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/common/address.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/common/configsrecord.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/common/constant.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/common/date.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/common/dp.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/common/grpc.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/common/logger.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/common/metricsrecord.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/common/parameter.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/common/parametersrecord.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/common/recordset.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/common/retry_invoker.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/common/secure_aggregation/__init__.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/common/secure_aggregation/crypto/__init__.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/common/secure_aggregation/crypto/shamir.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/common/secure_aggregation/crypto/symmetric_encryption.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/common/secure_aggregation/ndarrays_arithmetic.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/common/secure_aggregation/quantization.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/common/secure_aggregation/secaggplus_constants.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/common/secure_aggregation/secaggplus_utils.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/common/telemetry.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/common/typing.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/common/version.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/driver/__init__.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/driver/app.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/driver/driver.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/driver/driver_client_proxy.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/driver/grpc_driver.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/flower/__init__.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/proto/__init__.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/proto/driver_pb2.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/proto/driver_pb2.pyi +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/proto/driver_pb2_grpc.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/proto/driver_pb2_grpc.pyi +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/proto/fleet_pb2.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/proto/fleet_pb2.pyi +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/proto/fleet_pb2_grpc.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/proto/fleet_pb2_grpc.pyi +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/proto/node_pb2.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/proto/node_pb2.pyi +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/proto/node_pb2_grpc.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/proto/node_pb2_grpc.pyi +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/proto/recordset_pb2.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/proto/recordset_pb2.pyi +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/proto/recordset_pb2_grpc.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/proto/recordset_pb2_grpc.pyi +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/proto/task_pb2.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/proto/task_pb2.pyi +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/proto/task_pb2_grpc.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/proto/task_pb2_grpc.pyi +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/proto/transport_pb2.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/proto/transport_pb2.pyi +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/proto/transport_pb2_grpc.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/proto/transport_pb2_grpc.pyi +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/py.typed +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/server/__init__.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/server/app.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/server/client_manager.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/server/client_proxy.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/server/criterion.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/server/driver/__init__.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/server/driver/driver_servicer.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/server/fleet/__init__.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/server/fleet/grpc_bidi/__init__.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/server/fleet/grpc_bidi/driver_client_manager.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/server/fleet/grpc_bidi/flower_service_servicer.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/server/fleet/grpc_bidi/grpc_bridge.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/server/fleet/grpc_bidi/grpc_client_proxy.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/server/fleet/grpc_bidi/grpc_server.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/server/fleet/grpc_bidi/ins_scheduler.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/server/fleet/grpc_rere/__init__.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/server/fleet/grpc_rere/fleet_servicer.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/server/fleet/message_handler/__init__.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/server/fleet/message_handler/message_handler.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/server/fleet/rest_rere/__init__.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/server/fleet/rest_rere/rest_api.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/server/history.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/server/server.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/server/state/__init__.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/server/state/in_memory_state.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/server/state/sqlite_state.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/server/state/state.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/server/state/state_factory.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/server/strategy/__init__.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/server/strategy/aggregate.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/server/strategy/bulyan.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/server/strategy/dpfedavg_adaptive.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/server/strategy/dpfedavg_fixed.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/server/strategy/fault_tolerant_fedavg.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/server/strategy/fedadagrad.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/server/strategy/fedadam.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/server/strategy/fedavg.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/server/strategy/fedavg_android.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/server/strategy/fedavgm.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/server/strategy/fedmedian.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/server/strategy/fedopt.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/server/strategy/fedprox.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/server/strategy/fedtrimmedavg.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/server/strategy/fedxgb_bagging.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/server/strategy/fedxgb_cyclic.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/server/strategy/fedxgb_nn_avg.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/server/strategy/fedyogi.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/server/strategy/krum.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/server/strategy/qfedavg.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/server/strategy/strategy.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/server/utils/__init__.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/server/utils/tensorboard.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/server/utils/validator.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/simulation/__init__.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/simulation/app.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/simulation/ray_transport/__init__.py +0 -0
- {flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/simulation/ray_transport/utils.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: flwr-nightly
|
3
|
-
Version: 1.7.0.
|
3
|
+
Version: 1.7.0.dev20240126
|
4
4
|
Summary: Flower: A Friendly Federated Learning Framework
|
5
5
|
Home-page: https://flower.dev
|
6
6
|
License: Apache-2.0
|
@@ -184,6 +184,7 @@ Other [examples](https://github.com/adap/flower/tree/main/examples):
|
|
184
184
|
- [Advanced Flower with TensorFlow/Keras](https://github.com/adap/flower/tree/main/examples/advanced-tensorflow)
|
185
185
|
- [Advanced Flower with PyTorch](https://github.com/adap/flower/tree/main/examples/advanced-pytorch)
|
186
186
|
- Single-Machine Simulation of Federated Learning Systems ([PyTorch](https://github.com/adap/flower/tree/main/examples/simulation_pytorch)) ([Tensorflow](https://github.com/adap/flower/tree/main/examples/simulation_tensorflow))
|
187
|
+
- [Flower through Docker Compose and with Grafana dashboard](https://github.com/adap/flower/tree/main/examples/flower-via-docker-compose)
|
187
188
|
|
188
189
|
## Community
|
189
190
|
|
@@ -135,6 +135,7 @@ Other [examples](https://github.com/adap/flower/tree/main/examples):
|
|
135
135
|
- [Advanced Flower with TensorFlow/Keras](https://github.com/adap/flower/tree/main/examples/advanced-tensorflow)
|
136
136
|
- [Advanced Flower with PyTorch](https://github.com/adap/flower/tree/main/examples/advanced-pytorch)
|
137
137
|
- Single-Machine Simulation of Federated Learning Systems ([PyTorch](https://github.com/adap/flower/tree/main/examples/simulation_pytorch)) ([Tensorflow](https://github.com/adap/flower/tree/main/examples/simulation_tensorflow))
|
138
|
+
- [Flower through Docker Compose and with Grafana dashboard](https://github.com/adap/flower/tree/main/examples/flower-via-docker-compose)
|
138
139
|
|
139
140
|
## Community
|
140
141
|
|
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
|
|
4
4
|
|
5
5
|
[tool.poetry]
|
6
6
|
name = "flwr-nightly"
|
7
|
-
version = "1.7.0-
|
7
|
+
version = "1.7.0-dev20240126"
|
8
8
|
description = "Flower: A Friendly Federated Learning Framework"
|
9
9
|
license = "Apache-2.0"
|
10
10
|
authors = ["The Flower Authors <hello@flower.dev>"]
|
@@ -81,7 +81,7 @@ rest = ["requests", "starlette", "uvicorn"]
|
|
81
81
|
[tool.poetry.group.dev.dependencies]
|
82
82
|
types-dataclasses = "==0.6.6"
|
83
83
|
types-protobuf = "==3.19.18"
|
84
|
-
types-requests = "==2.31.0.
|
84
|
+
types-requests = "==2.31.0.20240125"
|
85
85
|
types-setuptools = "==69.0.0.20240115"
|
86
86
|
clang-format = "==17.0.4"
|
87
87
|
isort = "==5.13.2"
|
@@ -352,7 +352,7 @@ def _start_client_internal(
|
|
352
352
|
break
|
353
353
|
|
354
354
|
# Register state
|
355
|
-
node_state.
|
355
|
+
node_state.register_context(run_id=task_ins.run_id)
|
356
356
|
|
357
357
|
# Load app
|
358
358
|
app: Flower = load_flower_callable_fn()
|
@@ -360,14 +360,14 @@ def _start_client_internal(
|
|
360
360
|
# Handle task message
|
361
361
|
fwd_msg: Fwd = Fwd(
|
362
362
|
task_ins=task_ins,
|
363
|
-
|
363
|
+
context=node_state.retrieve_context(run_id=task_ins.run_id),
|
364
364
|
)
|
365
365
|
bwd_msg: Bwd = app(fwd=fwd_msg)
|
366
366
|
|
367
367
|
# Update node state
|
368
|
-
node_state.
|
369
|
-
run_id=
|
370
|
-
|
368
|
+
node_state.update_context(
|
369
|
+
run_id=fwd_msg.task_ins.run_id,
|
370
|
+
context=bwd_msg.context,
|
371
371
|
)
|
372
372
|
|
373
373
|
# Send
|
{flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/client/client.py
RENAMED
@@ -19,7 +19,6 @@ from __future__ import annotations
|
|
19
19
|
|
20
20
|
from abc import ABC
|
21
21
|
|
22
|
-
from flwr.client.run_state import RunState
|
23
22
|
from flwr.common import (
|
24
23
|
Code,
|
25
24
|
EvaluateIns,
|
@@ -33,12 +32,13 @@ from flwr.common import (
|
|
33
32
|
Parameters,
|
34
33
|
Status,
|
35
34
|
)
|
35
|
+
from flwr.common.context import Context
|
36
36
|
|
37
37
|
|
38
38
|
class Client(ABC):
|
39
39
|
"""Abstract base class for Flower clients."""
|
40
40
|
|
41
|
-
|
41
|
+
context: Context
|
42
42
|
|
43
43
|
def get_properties(self, ins: GetPropertiesIns) -> GetPropertiesRes:
|
44
44
|
"""Return set of client's properties.
|
@@ -141,13 +141,13 @@ class Client(ABC):
|
|
141
141
|
metrics={},
|
142
142
|
)
|
143
143
|
|
144
|
-
def
|
145
|
-
"""Get the run
|
146
|
-
return self.
|
144
|
+
def get_context(self) -> Context:
|
145
|
+
"""Get the run context from this client."""
|
146
|
+
return self.context
|
147
147
|
|
148
|
-
def
|
149
|
-
"""Apply a run
|
150
|
-
self.
|
148
|
+
def set_context(self, context: Context) -> None:
|
149
|
+
"""Apply a run context to this client."""
|
150
|
+
self.context = context
|
151
151
|
|
152
152
|
def to_client(self) -> Client:
|
153
153
|
"""Return client (itself)."""
|
{flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/client/flower.py
RENAMED
@@ -56,12 +56,12 @@ class Flower:
|
|
56
56
|
) -> None:
|
57
57
|
# Create wrapper function for `handle`
|
58
58
|
def ffn(fwd: Fwd) -> Bwd: # pylint: disable=invalid-name
|
59
|
-
task_res,
|
59
|
+
task_res, context_updated = handle(
|
60
60
|
client_fn=client_fn,
|
61
|
-
|
61
|
+
context=fwd.context,
|
62
62
|
task_ins=fwd.task_ins,
|
63
63
|
)
|
64
|
-
return Bwd(task_res=task_res,
|
64
|
+
return Bwd(task_res=task_res, context=context_updated)
|
65
65
|
|
66
66
|
# Wrap middleware layers around the wrapped handle function
|
67
67
|
self._call = make_ffn(ffn, layers if layers is not None else [])
|
@@ -28,10 +28,10 @@ from flwr.client.message_handler.task_handler import (
|
|
28
28
|
get_server_message_from_task_ins,
|
29
29
|
wrap_client_message_in_task_res,
|
30
30
|
)
|
31
|
-
from flwr.client.run_state import RunState
|
32
31
|
from flwr.client.secure_aggregation import SecureAggregationHandler
|
33
32
|
from flwr.client.typing import ClientFn
|
34
33
|
from flwr.common import serde
|
34
|
+
from flwr.common.context import Context
|
35
35
|
from flwr.proto.task_pb2 import ( # pylint: disable=E0611
|
36
36
|
SecureAggregation,
|
37
37
|
Task,
|
@@ -88,16 +88,16 @@ def handle_control_message(task_ins: TaskIns) -> Tuple[Optional[TaskRes], int]:
|
|
88
88
|
|
89
89
|
|
90
90
|
def handle(
|
91
|
-
client_fn: ClientFn,
|
92
|
-
) -> Tuple[TaskRes,
|
91
|
+
client_fn: ClientFn, context: Context, task_ins: TaskIns
|
92
|
+
) -> Tuple[TaskRes, Context]:
|
93
93
|
"""Handle incoming TaskIns from the server.
|
94
94
|
|
95
95
|
Parameters
|
96
96
|
----------
|
97
97
|
client_fn : ClientFn
|
98
98
|
A callable that instantiates a Client.
|
99
|
-
|
100
|
-
A dataclass storing the
|
99
|
+
context : Context
|
100
|
+
A dataclass storing the context for the run being executed by the client.
|
101
101
|
task_ins: TaskIns
|
102
102
|
The task instruction coming from the server, to be processed by the client.
|
103
103
|
|
@@ -110,7 +110,7 @@ def handle(
|
|
110
110
|
if server_msg is None:
|
111
111
|
# Instantiate the client
|
112
112
|
client = client_fn("-1")
|
113
|
-
client.
|
113
|
+
client.set_context(context)
|
114
114
|
# Secure Aggregation
|
115
115
|
if task_ins.task.HasField("sa") and isinstance(
|
116
116
|
client, SecureAggregationHandler
|
@@ -127,24 +127,24 @@ def handle(
|
|
127
127
|
sa=SecureAggregation(named_values=serde.named_values_to_proto(res)),
|
128
128
|
),
|
129
129
|
)
|
130
|
-
return task_res, client.
|
130
|
+
return task_res, client.get_context()
|
131
131
|
raise NotImplementedError()
|
132
|
-
client_msg,
|
132
|
+
client_msg, updated_context = handle_legacy_message(client_fn, context, server_msg)
|
133
133
|
task_res = wrap_client_message_in_task_res(client_msg)
|
134
|
-
return task_res,
|
134
|
+
return task_res, updated_context
|
135
135
|
|
136
136
|
|
137
137
|
def handle_legacy_message(
|
138
|
-
client_fn: ClientFn,
|
139
|
-
) -> Tuple[ClientMessage,
|
138
|
+
client_fn: ClientFn, context: Context, server_msg: ServerMessage
|
139
|
+
) -> Tuple[ClientMessage, Context]:
|
140
140
|
"""Handle incoming messages from the server.
|
141
141
|
|
142
142
|
Parameters
|
143
143
|
----------
|
144
144
|
client_fn : ClientFn
|
145
145
|
A callable that instantiates a Client.
|
146
|
-
|
147
|
-
A dataclass storing the
|
146
|
+
context : Context
|
147
|
+
A dataclass storing the context for the run being executed by the client.
|
148
148
|
server_msg: ServerMessage
|
149
149
|
The message coming from the server, to be processed by the client.
|
150
150
|
|
@@ -161,7 +161,7 @@ def handle_legacy_message(
|
|
161
161
|
|
162
162
|
# Instantiate the client
|
163
163
|
client = client_fn("-1")
|
164
|
-
client.
|
164
|
+
client.set_context(context)
|
165
165
|
# Execute task
|
166
166
|
message = None
|
167
167
|
if field == "get_properties_ins":
|
@@ -173,7 +173,7 @@ def handle_legacy_message(
|
|
173
173
|
if field == "evaluate_ins":
|
174
174
|
message = _evaluate(client, server_msg.evaluate_ins)
|
175
175
|
if message:
|
176
|
-
return message, client.
|
176
|
+
return message, client.get_context()
|
177
177
|
raise UnknownServerMessage()
|
178
178
|
|
179
179
|
|
{flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/client/node_state.py
RENAMED
@@ -17,7 +17,8 @@
|
|
17
17
|
|
18
18
|
from typing import Any, Dict
|
19
19
|
|
20
|
-
from flwr.
|
20
|
+
from flwr.common.context import Context
|
21
|
+
from flwr.common.recordset import RecordSet
|
21
22
|
|
22
23
|
|
23
24
|
class NodeState:
|
@@ -25,24 +26,24 @@ class NodeState:
|
|
25
26
|
|
26
27
|
def __init__(self) -> None:
|
27
28
|
self._meta: Dict[str, Any] = {} # holds metadata about the node
|
28
|
-
self.
|
29
|
+
self.run_contexts: Dict[int, Context] = {}
|
29
30
|
|
30
|
-
def
|
31
|
-
"""Register new run
|
32
|
-
if run_id not in self.
|
33
|
-
self.
|
31
|
+
def register_context(self, run_id: int) -> None:
|
32
|
+
"""Register new run context for this node."""
|
33
|
+
if run_id not in self.run_contexts:
|
34
|
+
self.run_contexts[run_id] = Context(state=RecordSet())
|
34
35
|
|
35
|
-
def
|
36
|
-
"""Get run
|
37
|
-
if run_id in self.
|
38
|
-
return self.
|
36
|
+
def retrieve_context(self, run_id: int) -> Context:
|
37
|
+
"""Get run context given a run_id."""
|
38
|
+
if run_id in self.run_contexts:
|
39
|
+
return self.run_contexts[run_id]
|
39
40
|
|
40
41
|
raise RuntimeError(
|
41
|
-
f"
|
42
|
-
" A run must be registered before it can be retrieved or updated "
|
42
|
+
f"Context for run_id={run_id} doesn't exist."
|
43
|
+
" A run context must be registered before it can be retrieved or updated "
|
43
44
|
" by a client."
|
44
45
|
)
|
45
46
|
|
46
|
-
def
|
47
|
-
"""Update run
|
48
|
-
self.
|
47
|
+
def update_context(self, run_id: int, context: Context) -> None:
|
48
|
+
"""Update run context."""
|
49
|
+
self.run_contexts[run_id] = context
|
@@ -16,17 +16,22 @@
|
|
16
16
|
|
17
17
|
|
18
18
|
from flwr.client.node_state import NodeState
|
19
|
-
from flwr.
|
19
|
+
from flwr.common.configsrecord import ConfigsRecord
|
20
|
+
from flwr.common.context import Context
|
20
21
|
from flwr.proto.task_pb2 import TaskIns # pylint: disable=E0611
|
21
22
|
|
22
23
|
|
23
|
-
def _run_dummy_task(
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
24
|
+
def _run_dummy_task(context: Context) -> Context:
|
25
|
+
counter_value: str = "1"
|
26
|
+
if "counter" in context.state.configs.keys():
|
27
|
+
counter_value = context.get_configs("counter")["count"] # type: ignore
|
28
|
+
counter_value += "1"
|
28
29
|
|
29
|
-
|
30
|
+
context.state.set_configs(
|
31
|
+
name="counter", record=ConfigsRecord({"count": counter_value})
|
32
|
+
)
|
33
|
+
|
34
|
+
return context
|
30
35
|
|
31
36
|
|
32
37
|
def test_multirun_in_node_state() -> None:
|
@@ -43,17 +48,17 @@ def test_multirun_in_node_state() -> None:
|
|
43
48
|
run_id = task.run_id
|
44
49
|
|
45
50
|
# Register
|
46
|
-
node_state.
|
51
|
+
node_state.register_context(run_id=run_id)
|
47
52
|
|
48
53
|
# Get run state
|
49
|
-
|
54
|
+
context = node_state.retrieve_context(run_id=run_id)
|
50
55
|
|
51
56
|
# Run "task"
|
52
|
-
updated_state = _run_dummy_task(
|
57
|
+
updated_state = _run_dummy_task(context)
|
53
58
|
|
54
59
|
# Update run state
|
55
|
-
node_state.
|
60
|
+
node_state.update_context(run_id=run_id, context=updated_state)
|
56
61
|
|
57
62
|
# Verify values
|
58
|
-
for run_id,
|
59
|
-
assert state.
|
63
|
+
for run_id, context in node_state.run_contexts.items():
|
64
|
+
assert context.state.get_configs("counter")["count"] == expected_values[run_id]
|
{flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/client/numpy_client.py
RENAMED
@@ -19,7 +19,6 @@ from abc import ABC
|
|
19
19
|
from typing import Callable, Dict, Tuple
|
20
20
|
|
21
21
|
from flwr.client.client import Client
|
22
|
-
from flwr.client.run_state import RunState
|
23
22
|
from flwr.common import (
|
24
23
|
Config,
|
25
24
|
NDArrays,
|
@@ -27,6 +26,7 @@ from flwr.common import (
|
|
27
26
|
ndarrays_to_parameters,
|
28
27
|
parameters_to_ndarrays,
|
29
28
|
)
|
29
|
+
from flwr.common.context import Context
|
30
30
|
from flwr.common.typing import (
|
31
31
|
Code,
|
32
32
|
EvaluateIns,
|
@@ -70,7 +70,7 @@ Example
|
|
70
70
|
class NumPyClient(ABC):
|
71
71
|
"""Abstract base class for Flower clients using NumPy."""
|
72
72
|
|
73
|
-
|
73
|
+
context: Context
|
74
74
|
|
75
75
|
def get_properties(self, config: Config) -> Dict[str, Scalar]:
|
76
76
|
"""Return a client's set of properties.
|
@@ -174,13 +174,13 @@ class NumPyClient(ABC):
|
|
174
174
|
_ = (self, parameters, config)
|
175
175
|
return 0.0, 0, {}
|
176
176
|
|
177
|
-
def
|
178
|
-
"""Get the run
|
179
|
-
return self.
|
177
|
+
def get_context(self) -> Context:
|
178
|
+
"""Get the run context from this client."""
|
179
|
+
return self.context
|
180
180
|
|
181
|
-
def
|
182
|
-
"""Apply a run
|
183
|
-
self.
|
181
|
+
def set_context(self, context: Context) -> None:
|
182
|
+
"""Apply a run context to this client."""
|
183
|
+
self.context = context
|
184
184
|
|
185
185
|
def to_client(self) -> Client:
|
186
186
|
"""Convert to object to Client type and return it."""
|
@@ -278,21 +278,21 @@ def _evaluate(self: Client, ins: EvaluateIns) -> EvaluateRes:
|
|
278
278
|
)
|
279
279
|
|
280
280
|
|
281
|
-
def
|
282
|
-
"""Return
|
283
|
-
return self.numpy_client.
|
281
|
+
def _get_context(self: Client) -> Context:
|
282
|
+
"""Return context of underlying NumPyClient."""
|
283
|
+
return self.numpy_client.get_context() # type: ignore
|
284
284
|
|
285
285
|
|
286
|
-
def
|
287
|
-
"""Apply
|
288
|
-
self.numpy_client.
|
286
|
+
def _set_context(self: Client, context: Context) -> None:
|
287
|
+
"""Apply context to underlying NumPyClient."""
|
288
|
+
self.numpy_client.set_context(context) # type: ignore
|
289
289
|
|
290
290
|
|
291
291
|
def _wrap_numpy_client(client: NumPyClient) -> Client:
|
292
292
|
member_dict: Dict[str, Callable] = { # type: ignore
|
293
293
|
"__init__": _constructor,
|
294
|
-
"
|
295
|
-
"
|
294
|
+
"get_context": _get_context,
|
295
|
+
"set_context": _set_context,
|
296
296
|
}
|
297
297
|
|
298
298
|
# Add wrapper type methods (if overridden)
|
{flwr_nightly-1.7.0.dev20240124 → flwr_nightly-1.7.0.dev20240126}/src/py/flwr/client/typing.py
RENAMED
@@ -17,7 +17,7 @@
|
|
17
17
|
from dataclasses import dataclass
|
18
18
|
from typing import Callable
|
19
19
|
|
20
|
-
from flwr.
|
20
|
+
from flwr.common.context import Context
|
21
21
|
from flwr.proto.task_pb2 import TaskIns, TaskRes # pylint: disable=E0611
|
22
22
|
|
23
23
|
from .client import Client as Client
|
@@ -28,7 +28,7 @@ class Fwd:
|
|
28
28
|
"""."""
|
29
29
|
|
30
30
|
task_ins: TaskIns
|
31
|
-
|
31
|
+
context: Context
|
32
32
|
|
33
33
|
|
34
34
|
@dataclass
|
@@ -36,7 +36,7 @@ class Bwd:
|
|
36
36
|
"""."""
|
37
37
|
|
38
38
|
task_res: TaskRes
|
39
|
-
|
39
|
+
context: Context
|
40
40
|
|
41
41
|
|
42
42
|
FlowerCallable = Callable[[Fwd], Bwd]
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright
|
1
|
+
# Copyright 2024 Flower Labs GmbH. All Rights Reserved.
|
2
2
|
#
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
4
|
# you may not use this file except in compliance with the License.
|
@@ -12,14 +12,27 @@
|
|
12
12
|
# See the License for the specific language governing permissions and
|
13
13
|
# limitations under the License.
|
14
14
|
# ==============================================================================
|
15
|
-
"""
|
15
|
+
"""Context."""
|
16
|
+
|
16
17
|
|
17
18
|
from dataclasses import dataclass
|
18
|
-
|
19
|
+
|
20
|
+
from .recordset import RecordSet
|
19
21
|
|
20
22
|
|
21
23
|
@dataclass
|
22
|
-
class
|
23
|
-
"""State of
|
24
|
+
class Context:
|
25
|
+
"""State of your run.
|
26
|
+
|
27
|
+
Parameters
|
28
|
+
----------
|
29
|
+
state : RecordSet
|
30
|
+
Holds records added by the entity in a given run and that will stay local.
|
31
|
+
This means that the data it holds will never leave the system it's running from.
|
32
|
+
This can be used as an intermediate storage or scratchpad when
|
33
|
+
executing middleware layers. It can also be used as a memory to access
|
34
|
+
at different points during the lifecycle of this entity (e.g. across
|
35
|
+
multiple rounds)
|
36
|
+
"""
|
24
37
|
|
25
|
-
state:
|
38
|
+
state: RecordSet
|
@@ -12,7 +12,7 @@
|
|
12
12
|
# See the License for the specific language governing permissions and
|
13
13
|
# limitations under the License.
|
14
14
|
# ==============================================================================
|
15
|
-
"""
|
15
|
+
"""Message."""
|
16
16
|
|
17
17
|
|
18
18
|
from dataclasses import dataclass
|
@@ -48,30 +48,17 @@ class Metadata:
|
|
48
48
|
|
49
49
|
|
50
50
|
@dataclass
|
51
|
-
class
|
51
|
+
class Message:
|
52
52
|
"""State of your application from the viewpoint of the entity using it.
|
53
53
|
|
54
54
|
Parameters
|
55
55
|
----------
|
56
|
-
in_message : RecordSet
|
57
|
-
Holds records sent by another entity (e.g. sent by the server-side
|
58
|
-
logic to a client, or vice-versa)
|
59
|
-
out_message : RecordSet
|
60
|
-
Holds records added by the current entity. This `RecordSet` will
|
61
|
-
be sent out (e.g. back to the server-side for aggregation of
|
62
|
-
parameter, or to the client to perform a certain task)
|
63
|
-
local : RecordSet
|
64
|
-
Holds record added by the current entity and that will stay local.
|
65
|
-
This means that the data it holds will never leave the system it's running from.
|
66
|
-
This can be used as an intermediate storage or scratchpad when
|
67
|
-
executing middleware layers. It can also be used as a memory to access
|
68
|
-
at different points during the lifecycle of this entity (e.g. across
|
69
|
-
multiple rounds)
|
70
56
|
metadata : Metadata
|
71
57
|
A dataclass including information about the task to be executed.
|
58
|
+
message : RecordSet
|
59
|
+
Holds records either sent by another entity (e.g. sent by the server-side
|
60
|
+
logic to a client, or vice-versa) or that will be sent to it.
|
72
61
|
"""
|
73
62
|
|
74
|
-
in_message: RecordSet
|
75
|
-
out_message: RecordSet
|
76
|
-
local: RecordSet
|
77
63
|
metadata: Metadata
|
64
|
+
message: RecordSet
|
@@ -40,20 +40,22 @@ from .typing import (
|
|
40
40
|
|
41
41
|
|
42
42
|
def parametersrecord_to_parameters(
|
43
|
-
record: ParametersRecord, keep_input: bool
|
43
|
+
record: ParametersRecord, keep_input: bool
|
44
44
|
) -> Parameters:
|
45
45
|
"""Convert ParameterRecord to legacy Parameters.
|
46
46
|
|
47
|
-
|
47
|
+
Warnings
|
48
|
+
--------
|
49
|
+
Because `Arrays` in `ParametersRecord` encode more information of the
|
48
50
|
array-like or tensor-like data (e.g their datatype, shape) than `Parameters` it
|
49
51
|
might not be possible to reconstruct such data structures from `Parameters` objects
|
50
|
-
alone. Additional information or
|
52
|
+
alone. Additional information or metadata must be provided from elsewhere.
|
51
53
|
|
52
54
|
Parameters
|
53
55
|
----------
|
54
56
|
record : ParametersRecord
|
55
57
|
The record to be conveted into Parameters.
|
56
|
-
keep_input : bool
|
58
|
+
keep_input : bool
|
57
59
|
A boolean indicating whether entries in the record should be deleted from the
|
58
60
|
input dictionary immediately after adding them to the record.
|
59
61
|
"""
|
@@ -74,7 +76,7 @@ def parametersrecord_to_parameters(
|
|
74
76
|
|
75
77
|
|
76
78
|
def parameters_to_parametersrecord(
|
77
|
-
parameters: Parameters, keep_input: bool
|
79
|
+
parameters: Parameters, keep_input: bool
|
78
80
|
) -> ParametersRecord:
|
79
81
|
"""Convert legacy Parameters into a single ParametersRecord.
|
80
82
|
|
@@ -86,7 +88,7 @@ def parameters_to_parametersrecord(
|
|
86
88
|
----------
|
87
89
|
parameters : Parameters
|
88
90
|
Parameters object to be represented as a ParametersRecord.
|
89
|
-
keep_input : bool
|
91
|
+
keep_input : bool
|
90
92
|
A boolean indicating whether parameters should be deleted from the input
|
91
93
|
Parameters object (i.e. a list of serialized NumPy arrays) immediately after
|
92
94
|
adding them to the record.
|
@@ -96,17 +98,17 @@ def parameters_to_parametersrecord(
|
|
96
98
|
p_record = ParametersRecord()
|
97
99
|
|
98
100
|
num_arrays = len(parameters.tensors)
|
101
|
+
ordered_dict = OrderedDict()
|
99
102
|
for idx in range(num_arrays):
|
100
103
|
if keep_input:
|
101
104
|
tensor = parameters.tensors[idx]
|
102
105
|
else:
|
103
106
|
tensor = parameters.tensors.pop(0)
|
104
|
-
|
105
|
-
|
106
|
-
{str(idx): Array(data=tensor, dtype="", stype=tensor_type, shape=[])}
|
107
|
-
)
|
107
|
+
ordered_dict[str(idx)] = Array(
|
108
|
+
data=tensor, dtype="", stype=tensor_type, shape=[]
|
108
109
|
)
|
109
110
|
|
111
|
+
p_record.set_parameters(ordered_dict, keep_input=keep_input)
|
110
112
|
return p_record
|
111
113
|
|
112
114
|
|
@@ -330,11 +332,15 @@ def getparametersins_to_recordset(getparameters_ins: GetParametersIns) -> Record
|
|
330
332
|
return recordset
|
331
333
|
|
332
334
|
|
333
|
-
def getparametersres_to_recordset(
|
335
|
+
def getparametersres_to_recordset(
|
336
|
+
getparametersres: GetParametersRes, keep_input: bool
|
337
|
+
) -> RecordSet:
|
334
338
|
"""Construct a RecordSet from a GetParametersRes object."""
|
335
339
|
recordset = RecordSet()
|
336
340
|
res_str = "getparametersres"
|
337
|
-
parameters_record = parameters_to_parametersrecord(
|
341
|
+
parameters_record = parameters_to_parametersrecord(
|
342
|
+
getparametersres.parameters, keep_input=keep_input
|
343
|
+
)
|
338
344
|
recordset.set_parameters(f"{res_str}.parameters", parameters_record)
|
339
345
|
|
340
346
|
# status
|
@@ -345,11 +351,13 @@ def getparametersres_to_recordset(getparametersres: GetParametersRes) -> RecordS
|
|
345
351
|
return recordset
|
346
352
|
|
347
353
|
|
348
|
-
def recordset_to_getparametersres(
|
354
|
+
def recordset_to_getparametersres(
|
355
|
+
recordset: RecordSet, keep_input: bool
|
356
|
+
) -> GetParametersRes:
|
349
357
|
"""Derive GetParametersRes from a RecordSet object."""
|
350
358
|
res_str = "getparametersres"
|
351
359
|
parameters = parametersrecord_to_parameters(
|
352
|
-
recordset.get_parameters(f"{res_str}.parameters")
|
360
|
+
recordset.get_parameters(f"{res_str}.parameters"), keep_input=keep_input
|
353
361
|
)
|
354
362
|
|
355
363
|
status = _extract_status_from_recordset(res_str, recordset)
|