WeightReceiver¶
- class torchrl.weight_update.WeightReceiver(scheme: WeightSyncScheme)[source]¶
Receives weights for ONE model in ONE worker.
This class handles receiving weights via transport and applying them to a registered model in the worker process.
- apply_weights(weights: Any) None[source]¶
Apply received weights to registered model.
- Parameters:
weights – The weights to apply.
- register_model(model_ref: Any) None[source]¶
Register the model to apply weights to.
- Parameters:
model_ref – Either a direct object reference or a string path like ‘policy’ or ‘env.value_net’.