class_docstr: Action distribution that operates on multiple, possibly nested actions.
class_docstr_tok: ["Action","distribution","that","operates","on","multiple",",","possibly","nested","actions","."]
code: def rsample(
      self,
      *,
      sample_shape: Tuple[int, ...] = None,
      **kwargs,
  ) -> Union[TensorType, Tuple[TensorType, TensorType]]:
      rsamples = []
      for dist in self._flat_child_distributions:
          rsample = dist.rsample(sample_shape=sample_shape, **kwargs)
          rsamples.append(rsample)
  
      rsamples = tree.unflatten_as(self._original_struct, rsamples)
  
      return rsamples
  
imports: import gymnasium
  import numpy
  from typing import Optional, List, Mapping, Iterable, Dict
  import tree
  import abc
  from ray.rllib.models.distributions import Distribution
  from ray.rllib.utils.annotations import override, DeveloperAPI
  from ray.rllib.utils.framework import try_import_torch
  from ray.rllib.utils.typing import TensorType, Union, Tuple
label_desc: Use image node_id 2 for calling the TorchMultiDistribution obj's underlying member method code with example usage: obj.rsample() and returns: rsamples