class_docstr: PyTorch policy class used with PGTrainer.
code: def __init__(self, observation_space, action_space, config: PGConfig):
      # Enforce AlgorithmConfig for PG Policies.
      if isinstance(config, dict):
          config = PGConfig.from_dict(config)
  
      TorchPolicyV2.__init__(
          self,
          observation_space,
          action_space,
          config,
          max_seq_len=config.model["max_seq_len"],
      )
  
      LearningRateSchedule.__init__(self, config.lr, config.lr_schedule)
  
      # TODO: Don't require users to call this manually.
      self._initialize_loss_from_dummy_batch()
  
imports: import logging
  from typing import Dict, List, Optional, Tuple, Type, Union
  from rllib_pg.pg.pg import PGConfig
  from rllib_pg.pg.utils import post_process_advantages
  from ray.rllib.evaluation.episode import Episode
  from ray.rllib.evaluation.postprocessing import Postprocessing
  from ray.rllib.models.modelv2 import ModelV2
  from ray.rllib.models.torch.torch_action_dist import TorchDistributionWrapper
  from ray.rllib.policy import Policy
  from ray.rllib.policy.sample_batch import SampleBatch
  from ray.rllib.policy.torch_mixins import LearningRateSchedule
  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.typing import AgentID, TensorType
label_desc: Use image node_id 1 to create a new PGTorchPolicy object from inherited base classes: LearningRateSchedule, TorchPolicyV2 with example: obj = PGTorchPolicy(observation_space, action_space, config)