class_docstr: PyTorch policy class used with MAML.
docstr: Workers use simple SGD for inner adaptation
  Meta-Policy uses Adam optimizer for meta-update
docstr_tok: ["Workers","use","simple","SGD","for","inner","adaptation","Meta-Policy","uses","Adam","optimizer","for","meta-update"]
code: def optimizer(
      self,
  ) -> Union[List["torch.optim.Optimizer"], "torch.optim.Optimizer"]:
      """
      Workers use simple SGD for inner adaptation
      Meta-Policy uses Adam optimizer for meta-update
      """
      if not self.config["worker_index"]:
          self.meta_opt = torch.optim.Adam(
              self.model.parameters(), lr=self.config["lr"]
          )
          return self.meta_opt
      return torch.optim.SGD(
          self.model.parameters(), lr=self.config["inner_lr"]
      )
  
imports: import logging
  from typing import Dict, List, Type, Union
  import ray
  from ray.rllib.algorithms.ppo.ppo_tf_policy import validate_config
  from ray.rllib.evaluation.postprocessing import Postprocessing, compute_gae_for_sample_batch
  from ray.rllib.models.modelv2 import ModelV2
  from ray.rllib.models.torch.torch_action_dist import TorchDistributionWrapper
  from ray.rllib.policy.sample_batch import SampleBatch
  from ray.rllib.policy.torch_mixins import ValueNetworkMixin
  from ray.rllib.policy.torch_policy_v2 import TorchPolicyV2
  from ray.rllib.utils.annotations import override
  from ray.rllib.utils.framework import try_import_torch
  from ray.rllib.utils.numpy import convert_to_numpy
  from ray.rllib.utils.torch_utils import apply_grad_clipping
  from ray.rllib.utils.typing import TensorType
label_desc: Use image node_id 3 for calling the MAMLTorchPolicy obj's underlying member method code with example usage: obj.optimizer() and returns: torch, self