class_docstr: Binding for `dm_control <https://arxiv.org/pdf/1801.00690.pdf>`.
docstr: Create a DMControlEnv.
  
  Args:
      env (dm_control.suite.Task): The wrapped dm_control environment.
      name (str): Name of the environment.
docstr_tok: ["Create","a","DMControlEnv",".","Args",":","env","(","dm_control.suite.Task",")",":","The","wrapped","dm_control","environment",".","name","(","str",")",":","Name","of","the","environment","."]
code: def __init__(self, env, name=None):
      """Create a DMControlEnv.
  
      Args:
          env (dm_control.suite.Task): The wrapped dm_control environment.
          name (str): Name of the environment.
  
      """
      self._env = env
      self._name = name or type(env.task).__name__
      self._viewer = None
      self._step_cnt = None
      self._max_episode_length = 1e12
      if self._env._step_limit != np.Inf:
          self._max_episode_length = int(self._env._step_limit)
  
      # action space
      action_spec = self._env.action_spec()
      if (len(action_spec.shape) == 1) and (
          -np.inf in action_spec.minimum
          or np.inf in action_spec.maximum
      ):
          self._action_space = akro.Discrete(np.prod(action_spec.shape))
      else:
          self._action_space = akro.Box(
              low=action_spec.minimum,
              high=action_spec.maximum,
              dtype=np.float32,
          )
  
      # observation_space
      flat_dim = _flat_shape(self._env.observation_spec())
      self._observation_space = akro.Box(
          low=-np.inf, high=np.inf, shape=[flat_dim], dtype=np.float32
      )
  
      # spec
      self._spec = EnvSpec(
          action_space=self.action_space,
          observation_space=self.observation_space,
          max_episode_length=self._max_episode_length,
      )
  
imports: import akro
  from dm_control import suite
  from dm_control.rl.control import flatten_observation
  from dm_env import StepType
  import numpy
  from garage import Environment, EnvSpec, EnvStep, StepType
  from garage.envs.dm_control.dm_control_viewer import DmControlViewer
label_desc: Use image node_id 1 to create a new DMControlEnv object from inherited base classes: Environment with example: obj = DMControlEnv(env, name)