Shortcuts

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’.

register_worker_transport(pipe: Any) None[source]

Register this worker’s communication pipe.

Parameters:

pipe – The pipe connection for this worker.

set_context(context: Any) None[source]

Set the context object (inner_collector) for resolving references.

Parameters:

context – The inner collector instance in the worker process.

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources