code: def test_obs_is_image(self):
      image_env = GymEnv(DummyDiscretePixelEnv(), is_image=True)
      with mock.patch(
          ("garage.tf.models." "categorical_cnn_model.CNNModel._build"),
          autospec=True,
          side_effect=CNNModel._build,
      ) as build:
          qf = DiscreteCNNQFunction(
              env_spec=image_env.spec,
              filters=((5, (3, 3)),),
              strides=(2,),
              dueling=False,
          )
          normalized_obs = build.call_args_list[0][0][1]
  
          input_ph = qf.input
          assert input_ph != normalized_obs
  
          fake_obs = [
              np.full(image_env.spec.observation_space.shape, 255)
          ]
          assert (
              self.sess.run(
                  normalized_obs, feed_dict={input_ph: fake_obs}
              )
              == 1.0
          ).all()
  
          obs_dim = image_env.spec.observation_space.shape
          state_input = tf.compat.v1.placeholder(
              tf.uint8, shape=(None,) + obs_dim
          )
  
          qf.build(state_input, name="another")
          normalized_obs = build.call_args_list[1][0][1]
  
          fake_obs = [
              np.full(image_env.spec.observation_space.shape, 255)
          ]
          assert (
              self.sess.run(
                  normalized_obs, feed_dict={state_input: fake_obs}
              )
              == 1.0
          ).all()
  
imports: import pickle
  from unittest import mock
  import numpy
  import pytest
  import tensorflow
  from garage.envs import GymEnv
  from garage.tf.models import CNNModel
  from garage.tf.q_functions import DiscreteCNNQFunction
  from tests.fixtures import TfGraphTestCase
  from tests.fixtures.envs.dummy import DummyDiscreteEnv, DummyDiscretePixelEnv
  from tests.fixtures.models import SimpleCNNModel, SimpleCNNModelWithMaxPooling, SimpleMLPModel
label_desc: Use image node_id 4 for calling the TestDiscreteCNNQFunction obj's underlying member method code with example usage: obj.test_obs_is_image() without return types