nvflare.app_opt.tensor_stream.client module¶
- class TensorClientStreamer(format: str = 'pytorch', tasks: list[str] | None = None, tensor_send_timeout=30.0)[source]¶
Bases:
FLComponentTensorClientSender handles receiving task data and sending task results tensors from/to server.
It uses a StreamableEngine, TensorReceiver, and TensorSender to manage tensor streaming on the client side. .. attribute:: format
The format of the tensors to send. Default is “pytorch”.
- type:
str
- tensor_send_timeout¶
Timeout for tensor entry transfer operations. Default is 30.0 seconds.
- Type:
float
- engine¶
The StreamableEngine used for tensor streaming.
- Type:
StreamableEngine
- sender¶
The TensorSender used to send tensors to the server.
- Type:
TensorSender
- receiver¶
The TensorReceiver used to receive tensors from the server.
- Type:
TensorReceiver
Initialize the TensorClientStreamer component.
- Parameters:
format (str) – The format of the tensors to send. Default is ExchangeFormat.TORCH.
tasks (list[str]) – The list of tasks to send tensors for. Default is None, which means the “train” task.
tensor_send_timeout (float) – Timeout for tensor entry transfer operations. Default is 30.0 seconds.
- handle_event(event_type: str, fl_ctx: FLContext)[source]¶
Handle events for the TensorSender component.
- Parameters:
event_type (str) – The type of event to handle.
fl_ctx (FLContext) – The FLContext for the current operation.