class_docstr: Coordinator of n (possibly remote) Learner workers.
  
  Each Learner worker has a copy of the RLModule, the loss function(s), and
  one or more optimizers.
docstr: Get the weights of the MultiAgentRLModule maintained by each Learner.
  
  Args:
      module_ids: The ids of the modules to get the weights of.
  
  Returns:
      A mapping of module ids to their weights.
docstr_tok: ["Get","the","weights","of","the","MultiAgentRLModule","maintained","by","each","Learner",".","Args",":","module_ids",":","The","ids","of","the","modules","to","get","the","weights","of",".","Returns",":","A","mapping","of","module","ids","to","their","weights","."]
code: def get_weights(
      self, module_ids: Optional[Set[str]] = None
  ) -> Dict[str, Any]:
      """Get the weights of the MultiAgentRLModule maintained by each Learner.
  
      Args:
          module_ids: The ids of the modules to get the weights of.
  
      Returns:
          A mapping of module ids to their weights.
  
      """
      if self.is_local:
          state = self._learner.get_module_state(module_ids)
      else:
          worker = self._worker_manager.healthy_actor_ids()[0]
          assert (
              len(self._workers)
              == self._worker_manager.num_healthy_actors()
          )
          state = self._worker_manager.foreach_actor(
              lambda w: w.get_module_state(module_ids),
              remote_actor_ids=[worker],
          )
          state = self._get_results(state)[0]
  
      return convert_to_numpy(state)
  
imports: from collections import defaultdict, Counter
  from functools import partial
  import pathlib
  from typing import Any, Callable, Dict, List, Optional, Set, Type, Union
  import uuid
  import ray
  from ray.rllib.algorithms.algorithm_config import AlgorithmConfig
  from ray.rllib.core.learner.learner import Learner
  from ray.rllib.core.learner.reduce_result_dict_fn import _reduce_mean_results
  from ray.rllib.core.rl_module.rl_module import SingleAgentRLModuleSpec, RLMODULE_STATE_DIR_NAME
  from ray.rllib.policy.sample_batch import MultiAgentBatch
  from ray.rllib.utils.actor_manager import FaultTolerantActorManager
  from ray.rllib.utils.deprecation import Deprecated, deprecation_warning
  from ray.rllib.utils.minibatch_utils import ShardBatchIterator, ShardEpisodesIterator
  from ray.rllib.utils.numpy import convert_to_numpy
  from ray.rllib.utils.typing import EpisodeType, ModuleID, ResultDict, RLModuleSpec, ShouldModuleBeUpdatedFn
  from ray.train._internal.backend_executor import BackendExecutor
  from ray.tune.utils.file_transfer import sync_dir_between_nodes
  from ray.util.annotations import PublicAPI
label_desc: Use image node_id 13 for calling the LearnerGroup obj's underlying member method code with example usage: obj.get_weights(module_ids) and returns: convert_to_numpy