class_docstr: Append a one-hot task representation to an environment.
  
  See TaskOnehotWrapper.wrap_env_list for the recommended way of creating
  this class.
  
  Args:
      env (Environment): The environment to wrap.
      task_index (int): The index of this task among the tasks.
      n_total_tasks (int): The number of total tasks.
class_docstr_tok: ["Append","a","one-hot","task","representation","to","an","environment",".","See","TaskOnehotWrapper.wrap_env_list","for","the","recommended","way","of","creating","this","class",".","Args",":","env","(","Environment",")",":","The","environment","to","wrap",".","task_index","(","int",")",":","The","index","of","this","task","among","the","tasks",".","n_total_tasks","(","int",")",":","The","number","of","total","tasks","."]
docstr: Environment step for the active task env.
  
  Args:
      action (np.ndarray): Action performed by the agent in the
          environment.
  
  Returns:
      EnvStep: The environment step resulting from the action.
docstr_tok: ["Environment","step","for","the","active","task","env",".","Args",":","action","(","np.ndarray",")",":","Action","performed","by","the","agent","in","the","environment",".","Returns",":","EnvStep",":","The","environment","step","resulting","from","the","action","."]
code: def step(self, action):
      """Environment step for the active task env.
  
      Args:
          action (np.ndarray): Action performed by the agent in the
              environment.
  
      Returns:
          EnvStep: The environment step resulting from the action.
  
      """
      es = self._env.step(action)
      obs = es.observation
      oh_obs = self._obs_with_one_hot(obs)
  
      env_info = es.env_info
  
      env_info["task_id"] = self._task_index
  
      return EnvStep(
          env_spec=self.spec,
          action=action,
          reward=es.reward,
          observation=oh_obs,
          env_info=env_info,
          step_type=es.step_type,
      )
  
file_path: garage/src/garage/envs/task_onehot_wrapper.py
imports: import akro
  import numpy
  from garage import EnvSpec, EnvStep, Wrapper
label_desc: Use image node_id 5 for calling the TaskOnehotWrapper obj's underlying member method code with example usage: obj.step(action) and returns: EnvStep