class_docstr: Hand-coded policy that returns random actions.
class_docstr_tok: ["Hand-coded","policy","that","returns","random","actions","."]
code: def __init__(self, *args, **kwargs):
      super().__init__(*args, **kwargs)
  
      # Whether for compute_actions, the bounds given in action_space
      # should be ignored (default: False). This is to test action-clipping
      # and any Env's reaction to bounds breaches.
      if self.config.get("ignore_action_bounds", False) and isinstance(
          self.action_space, Box
      ):
          self.action_space_for_sampling = Box(
              -float("inf"),
              float("inf"),
              shape=self.action_space.shape,
              dtype=self.action_space.dtype,
          )
      else:
          self.action_space_for_sampling = self.action_space
  
file_path: ray/python/ray/rllib/examples/policy/random_policy.py
imports: from gymnasium.spaces import Box
  import numpy
  import random
  import tree
  from typing import List, Optional, Union
  from ray.rllib.policy.policy import Policy
  from ray.rllib.policy.sample_batch import SampleBatch
  from ray.rllib.utils.annotations import override
  from ray.rllib.utils.typing import ModelWeights, TensorStructType, TensorType
label_desc: Use image node_id 1 to create a new RandomPolicy object from inherited base classes: Policy with example: obj = RandomPolicy()