Shortcuts

RayModuleTransformReceiver

class torchrl.weight_update.RayModuleTransformReceiver(scheme: RayModuleTransformScheme)[source]

Specialized receiver for RayModuleTransform actors.

This receiver handles weight updates within Ray actors. Since Ray actors receive weights through direct method calls, this receiver primarily validates and applies weights locally.

apply_weights(weights: Any) None[source]

Apply received weights to registered model.

For Ray actors, weights are applied directly to the module within the actor’s process space.

Parameters:

weights – The weights to apply.

register_model(model_ref: Any) None

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(actor_or_context: Any) None[source]

Register the Ray actor’s transport.

Parameters:

actor_or_context – Either a Ray actor reference or a context object.

set_context(context: Any) None

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