class_docstr: Internal adapter of VectorEnv to BaseEnv.
  
  We assume the caller will always send the full vector of actions in each
  call to send_actions(), and that they call reset_at() on all completed
  environments before calling send_actions().
class_docstr_tok: ["Internal","adapter","of","VectorEnv","to","BaseEnv",".","We","assume","the","caller","will","always","send","the","full","vector","of","actions","in","each","call","to","send_actions","(",")",",","and","that","they","call","reset_at","(",")","on","all","completed","environments","before","calling","send_actions","(",")","."]
docstr: Resets all or one particular sub-environment's state (by index).
  
  Args:
      idx: The index to reset at. If None, reset all the sub-environments' states.
code: def _init_env_state(self, idx: Optional[int] = None) -> None:
      """Resets all or one particular sub-environment's state (by index).
  
      Args:
          idx: The index to reset at. If None, reset all the sub-environments' states.
      """
      # If index is None, reset all sub-envs' states:
      if idx is None:
          self.new_obs = [None for _ in range(self.num_envs)]
          self.cur_rewards = [0.0 for _ in range(self.num_envs)]
          self.cur_terminateds = [False for _ in range(self.num_envs)]
          self.cur_truncateds = [False for _ in range(self.num_envs)]
          self.cur_infos = [{} for _ in range(self.num_envs)]
      # Index provided, reset only the sub-env's state at the given index.
      else:
          (
              self.new_obs[idx],
              self.cur_infos[idx],
          ) = self.vector_env.reset_at(idx)
          # Reset all other states to null values.
          self.cur_rewards[idx] = 0.0
          self.cur_terminateds[idx] = False
          self.cur_truncateds[idx] = False
  
imports: import logging
  import gymnasium
  import numpy
  from typing import Callable, List, Optional, Tuple, Union, Set
  from ray.rllib.env.base_env import BaseEnv, _DUMMY_AGENT_ID
  from ray.rllib.utils.annotations import Deprecated, override, PublicAPI
  from ray.rllib.utils.typing import EnvActionType, EnvID, EnvInfoDict, EnvObsType, EnvType, MultiEnvDict, AgentID
  from ray.util import log_once
label_desc: Use image node_id 13 for calling the VectorEnvWrapper obj's underlying member method code with example usage: obj._init_env_state(idx) without return types