code: def _get_torch_exploration_action(
      self,
      action_distribution: ActionDistribution,
      explore: bool,
      timestep: Union[int, TensorType],
  ) -> "torch.Tensor":
      per_slate_q_values = action_distribution.inputs
      all_slates = self.model.slates
      device = all_slates.device
  
      exploit_indices = action_distribution.deterministic_sample()
      exploit_indices = exploit_indices.to(device)
      exploit_action = all_slates[exploit_indices]
  
      batch_size = per_slate_q_values.size()[0]
      action_logp = torch.zeros(batch_size, dtype=torch.float)
  
      self.last_timestep = timestep
  
      # Explore.
      if explore:
          # Get the current epsilon.
          epsilon = self.epsilon_schedule(self.last_timestep)
          # A random action.
          random_indices = torch.randint(
              0,
              per_slate_q_values.shape[1],
              (per_slate_q_values.shape[0],),
              device=device,
          )
          random_actions = all_slates[random_indices]
  
          # Pick either random or greedy.
          action = torch.where(
              torch.empty((batch_size,)).uniform_() < epsilon,
              random_actions,
              exploit_action,
          )
          return action, action_logp
      # Return the deterministic "sample" (argmax) over the logits.
      else:
          return exploit_action, action_logp
  
file_path: ray/python/ray/rllib/utils/exploration/slate_epsilon_greedy.py
imports: from typing import Union
  from ray.rllib.models.action_dist import ActionDistribution
  from ray.rllib.utils.annotations import override, PublicAPI
  from ray.rllib.utils.exploration.epsilon_greedy import EpsilonGreedy
  from ray.rllib.utils.exploration.exploration import TensorType
  from ray.rllib.utils.framework import try_import_tf, try_import_torch
label_desc: Use image node_id 2 for calling the SlateEpsilonGreedy obj's underlying member method code with example usage: obj._get_torch_exploration_action(action_distribution, explore, timestep) and returns: action,  action_logp, exploit_action,  action_logp