docstr: Act randomly regardless of the observation.
docstr_tok: ["Act","randomly","regardless","of","the","observation","."]
code: def act(
      self,
      obs: rlt.FeatureData,
      possible_actions_mask: Optional[torch.Tensor] = None,
  ) -> rlt.ActorOutput:
      """Act randomly regardless of the observation."""
      # pyre-fixme[35]: Target cannot be annotated.
      obs: torch.Tensor = obs.float_features
      assert obs.dim() >= 2, f"obs has shape {obs.shape} (dim < 2)"
      assert (
          obs.shape[0] == 1
      ), f"obs has shape {obs.shape} (0th dim != 1)"
      batch_size = obs.shape[0]
      scores = torch.ones((batch_size, self.num_actions))
      scores = apply_possible_actions_mask(
          scores, possible_actions_mask, invalid_score=0.0
      )
  
      # sample a random action
      m = torch.distributions.Categorical(scores)
      raw_action = m.sample()
      action = F.one_hot(raw_action, self.num_actions)
      log_prob = m.log_prob(raw_action).float()
      return rlt.ActorOutput(action=action, log_prob=log_prob)
  
imports: from typing import List, Optional
  import gym
  import numpy
  import reagent.core.types
  import torch
  import torch.nn.functional
  from reagent.core.parameters import CONTINUOUS_TRAINING_ACTION_RANGE
  from reagent.gym.policies.policy import Policy
  from reagent.gym.policies.scorers.discrete_scorer import apply_possible_actions_mask
label_desc: Use image node_id 3 for calling the DiscreteRandomPolicy obj's underlying member method code with example usage: obj.act(obs, possible_actions_mask) and returns: rlt