class_docstr: Tests for TanhGaussianMLPPolicy.
class_docstr_tok: ["Tests","for","TanhGaussianMLPPolicy","."]
docstr: Test if observations from dict obs spaces are properly flattened.
docstr_tok: ["Test","if","observations","from","dict","obs","spaces","are","properly","flattened","."]
code: def test_get_action_dict_space(self):
      """Test if observations from dict obs spaces are properly flattened."""
      env = GymEnv(
          DummyDictEnv(obs_space_type="box", act_space_type="box")
      )
      policy = TanhGaussianMLPPolicy(
          env_spec=env.spec,
          hidden_nonlinearity=None,
          hidden_sizes=(1,),
          hidden_w_init=nn.init.ones_,
          output_w_init=nn.init.ones_,
      )
      obs = env.reset()[0]
  
      action, _ = policy.get_action(obs)
      assert env.action_space.shape == action.shape
  
      actions, _ = policy.get_actions(np.array([obs, obs]))
      for action in actions:
          assert env.action_space.shape == action.shape
  
file_path: garage/tests/garage/torch/policies/test_tanh_gaussian_mlp_policy.py
imports: import pickle
  import numpy
  import pytest
  import torch
  from torch import nn
  from garage.envs import GymEnv
  from garage.torch.policies import TanhGaussianMLPPolicy
  from tests.fixtures.envs.dummy import DummyBoxEnv, DummyDictEnv
label_desc: Use image node_id 7 for calling the TestTanhGaussianMLPPolicy obj's underlying member method code with example usage: obj.test_get_action_dict_space() without return types