code: def test_get_qval(self, filters, strides):
      env = GymEnv(DummyDiscretePixelEnv())
      obs = env.reset()[0]
  
      with mock.patch(
          ("garage.tf.models." "cnn_mlp_merge_model.CNNModel"),
          new=SimpleCNNModel,
      ):
          with mock.patch(
              ("garage.tf.models." "cnn_mlp_merge_model.MLPMergeModel"),
              new=SimpleMLPMergeModel,
          ):
              qf = ContinuousCNNQFunction(
                  env_spec=env.spec, filters=filters, strides=strides
              )
  
      action_dim = env.action_space.shape
  
      obs = env.step(1).observation
  
      act = np.full(action_dim, 0.5)
      expected_output = np.full((1,), 0.5)
  
      outputs = qf.get_qval([obs], [act])
  
      assert np.array_equal(outputs[0], expected_output)
  
      outputs = qf.get_qval([obs, obs, obs], [act, act, act])
  
      for output in outputs:
          assert np.array_equal(output, expected_output)
  
      # make sure observations are unflattened
  
      obs = env.observation_space.flatten(obs)
      qf._f_qval = mock.MagicMock()
  
      qf.get_qval([obs], [act])
      unflattened_obs = qf._f_qval.call_args_list[0][0][0]
      assert (
          unflattened_obs.shape[1:] == env.spec.observation_space.shape
      )
  
      qf.get_qval([obs, obs], [act, act])
      unflattened_obs = qf._f_qval.call_args_list[1][0][0]
      assert (
          unflattened_obs.shape[1:] == env.spec.observation_space.shape
      )
  
imports: import pickle
  from unittest import mock
  import numpy
  import pytest
  import tensorflow
  from garage.envs import GymEnv
  from garage.tf.q_functions import ContinuousCNNQFunction
  from tests.fixtures import TfGraphTestCase
  from tests.fixtures.envs.dummy import DummyDictEnv, DummyDiscreteEnv, DummyDiscretePixelEnv
  from tests.fixtures.models import SimpleCNNModel, SimpleCNNModelWithMaxPooling, SimpleMLPMergeModel
label_desc: Use image node_id 1 for calling the TestContinuousCNNQFunction obj's underlying member method code with example usage: obj.test_get_qval(filters, strides) without return types