class_docstr: Implements APPO loss / update logic on top of ImpalaTorchLearner.
class_docstr_tok: ["Implements","APPO","loss","\/","update","logic","on","top","of","ImpalaTorchLearner","."]
code: def _update_module_target_networks(
      self, module_id: ModuleID, config: APPOConfig
  ) -> None:
      module = self.module[module_id]
  
      target_current_network_pairs = module.get_target_network_pairs()
      for (
          target_network,
          current_network,
      ) in target_current_network_pairs:
          current_state_dict = current_network.state_dict()
          new_state_dict = {
              k: config.tau * current_state_dict[k]
              + (1 - config.tau) * v
              for k, v in target_network.state_dict().items()
          }
          target_network.load_state_dict(new_state_dict)
  
imports: from typing import Any, Dict
  from ray.rllib.policy.sample_batch import SampleBatch
  from ray.rllib.algorithms.appo.appo import APPOConfig, LEARNER_RESULTS_CURR_KL_COEFF_KEY, LEARNER_RESULTS_KL_KEY, OLD_ACTION_DIST_LOGITS_KEY
  from ray.rllib.algorithms.appo.appo_learner import AppoLearner
  from ray.rllib.algorithms.impala.torch.vtrace_torch_v2 import make_time_major, vtrace_torch
  from ray.rllib.core.learner.learner import POLICY_LOSS_KEY, VF_LOSS_KEY, ENTROPY_KEY
  from ray.rllib.core.learner.torch.torch_learner import TorchLearner
  from ray.rllib.core.rl_module.marl_module import MultiAgentRLModule
  from ray.rllib.core.rl_module.torch.torch_rl_module import TorchDDPRLModuleWithTargetNetworksInterface, TorchRLModule
  from ray.rllib.core.rl_module.rl_module_with_target_networks_interface import RLModuleWithTargetNetworksInterface
  from ray.rllib.utils.annotations import override
  from ray.rllib.utils.framework import try_import_torch
  from ray.rllib.utils.nested_dict import NestedDict
  from ray.rllib.utils.typing import ModuleID, TensorType
label_desc: Use image node_id 3 for calling the APPOTorchLearner obj's underlying member method code with example usage: obj._update_module_target_networks(module_id, config) without return types