docstr: Test if a flattened image obs is passed to get_action
  then it is unflattened.
docstr_tok: ["Test","if","a","flattened","image","obs","is","passed","to","get_action","then","it","is","unflattened","."]
code: def test_obs_unflattened(
      self, kernel_sizes, hidden_channels, strides, paddings
  ):
      """Test if a flattened image obs is passed to get_action
      then it is unflattened.
      """
      env = GymEnv(DummyDiscretePixelEnv())
      env.reset()
      policy = DiscreteCNNPolicy(
          env_spec=env.spec,
          image_format="NHWC",
          hidden_channels=hidden_channels,
          kernel_sizes=kernel_sizes,
          strides=strides,
          paddings=paddings,
          padding_mode="zeros",
          hidden_w_init=nn.init.ones_,
          output_w_init=nn.init.ones_,
      )
  
      obs = env.observation_space.sample()
      action, _ = policy.get_action(env.observation_space.flatten(obs))
      env.step(action[0])
  
file_path: garage/tests/garage/torch/policies/test_discrete_cnn_policy.py
imports: import cloudpickle
  import pytest
  import torch.nn
  from garage.envs import GymEnv
  from garage.torch.policies import DiscreteCNNPolicy
  from tests.fixtures.envs.dummy import DummyDiscretePixelEnv
label_desc: Use image node_id 4 for calling the TestDiscreteCNNPolicy obj's underlying member method code with example usage: obj.test_obs_unflattened(kernel_sizes, hidden_channels, strides, paddings) without return types