class_docstr: Implements Decision Transformer: https://arxiv.org/abs/2106.01345.
class_docstr_tok: ["Implements","Decision","Transformer",":","https",":","\/\/arxiv.org\/abs\/2106.01345","."]
docstr: Computes an action for the specified policy on the local worker.
  
  Note that you can also access the policy object through
  self.get_policy(policy_id) and call compute_single_action() on it
  directly.
  
  Args:
      input_dict: A SampleBatch taken from get_initial_input_dict or
          get_next_input_dict.
      full_fetch: Whether to return extra action fetch results.
          This is always True for DT.
      kwargs: forward compatibility args.
  
  Returns:
      A tuple containing: (
          the computed action,
          list of RNN states (empty for DT),
          extra action output (pass to get_next_input_dict),
      )
docstr_tok: ["Computes","an","action","for","the","specified","policy","on","the","local","worker",".","Note","that","you","can","also","access","the","policy","object","through","self.get_policy","(","policy_id",")","and","call","compute_single_action","(",")","on","it","directly",".","Args",":","input_dict",":","A","SampleBatch","taken","from","get_initial_input_dict","or","get_next_input_dict",".","full_fetch",":","Whether","to","return","extra","action","fetch","results",".","This","is","always","True","for","DT",".","kwargs",":","forward","compatibility","args",".","Returns",":","A","tuple","containing",":","(","the","computed","action",",","list","of","RNN","states","(","empty","for","DT",")",",","extra","action","output","(","pass","to","get_next_input_dict",")",",",")"]
code: def compute_single_action(
      self,
      *args,
      input_dict: Optional[SampleBatch] = None,
      full_fetch: bool = True,
      **kwargs,
  ) -> Tuple[TensorStructType, List[TensorType], Dict[str, TensorType]]:
      """Computes an action for the specified policy on the local worker.
  
      Note that you can also access the policy object through
      self.get_policy(policy_id) and call compute_single_action() on it
      directly.
  
      Args:
          input_dict: A SampleBatch taken from get_initial_input_dict or
              get_next_input_dict.
          full_fetch: Whether to return extra action fetch results.
              This is always True for DT.
          kwargs: forward compatibility args.
  
      Returns:
          A tuple containing: (
              the computed action,
              list of RNN states (empty for DT),
              extra action output (pass to get_next_input_dict),
          )
      """
      assert input_dict is not None, (
          "DT must take in input_dict for inference. "
          "See get_initial_input_dict() and get_next_input_dict()."
      )
      assert (
          full_fetch
      ), "DT needs full_fetch=True. Pass extra into get_next_input_dict()."
  
      return super().compute_single_action(
          *args,
          input_dict=input_dict.copy(),
          full_fetch=full_fetch,
          **kwargs,
      )
  
imports: import logging
  import math
  from typing import Any, Dict, List, Optional, Tuple, Type, Union
  from rllib_dt.dt.segmentation_buffer import MultiAgentSegmentationBuffer
  from ray.rllib import SampleBatch
  from ray.rllib.algorithms.algorithm import Algorithm
  from ray.rllib.algorithms.algorithm_config import AlgorithmConfig, NotProvided
  from ray.rllib.execution import synchronous_parallel_sample
  from ray.rllib.execution.train_ops import multi_gpu_train_one_step, train_one_step
  from ray.rllib.policy import Policy
  from ray.rllib.policy.sample_batch import DEFAULT_POLICY_ID
  from ray.rllib.utils import deep_update
  from ray.rllib.utils.annotations import PublicAPI, override
  from ray.rllib.utils.metrics import NUM_AGENT_STEPS_SAMPLED, NUM_AGENT_STEPS_TRAINED, NUM_ENV_STEPS_SAMPLED, SAMPLE_TIMER
  from ray.rllib.utils.typing import PolicyID, ResultDict, TensorStructType, TensorType
label_desc: Use image node_id 4 for calling the DT obj's underlying member method code with example usage: obj.compute_single_action() and returns: super