code: def test_output_value_max_pooling(
      self, filters, in_channels, strides, pool_strides, pool_shapes
  ):
      model = CNNMLPMergeModel(
          input_dim=self.input_shape,
          filters=filters,
          strides=strides,
          name="cnn_mlp_merge_model2",
          padding="VALID",
          max_pooling=True,
          action_merge_layer=1,
          pool_strides=pool_strides,
          pool_shapes=pool_shapes,
          cnn_hidden_w_init=tf.constant_initializer(1),
          hidden_nonlinearity=self.hidden_nonlinearity,
      )
  
      model_out = model.build(self.obs_ph, self.action_ph).outputs
  
      filter_sum = 1
      # filter value after 3 layers of conv
      for filter_iter, in_channel in zip(filters, in_channels):
          filter_sum *= (
              filter_iter[1][0] * filter_iter[1][1] * in_channel
          )
  
      height_size = self.input_height
      width_size = self.input_width
      for filter_iter, stride in zip(filters, strides):
          height_size = (
              int((height_size - filter_iter[1][0]) / stride) + 1
          )
          height_size = (
              int((height_size - pool_shapes[0]) / pool_strides[0]) + 1
          )
          width_size = (
              int((width_size - filter_iter[1][1]) / stride) + 1
          )
          width_size = (
              int((width_size - pool_shapes[1]) / pool_strides[1]) + 1
          )
  
      flatten_shape = height_size * width_size * filters[-1][0]
  
      # flatten
      cnn_output = np.full(
          (self.batch_size, flatten_shape), filter_sum, dtype=np.float32
      )
  
      # feed cnn output to MLPMergeModel
      with tf.compat.v1.variable_scope(
          "cnn_mlp_merge_model2/MLPMergeModel", reuse=True
      ):
          h0_w = tf.compat.v1.get_variable("mlp_concat/hidden_0/kernel")
          h0_b = tf.compat.v1.get_variable("mlp_concat/hidden_0/bias")
          out_w = tf.compat.v1.get_variable("mlp_concat/output/kernel")
          out_b = tf.compat.v1.get_variable("mlp_concat/output/bias")
  
      mlp_output = self.sess.run(
          model_out,
          feed_dict={
              self.obs_ph: self.obs_input,
              self.action_ph: self.action_input,
          },
      )
  
      # First layer
      h0_in = tf.matmul(cnn_output, h0_w) + h0_b
      h0_out = self.hidden_nonlinearity(h0_in)
  
      # output
      h1_in = (
          tf.matmul(tf.concat([h0_out, self.action_input], 1), out_w)
          + out_b
      )
  
      # eval output
      out = self.sess.run(
          h1_in,
          feed_dict={
              self.obs_ph: self.obs_input,
              self.action_ph: self.action_input,
          },
      )
  
      np.testing.assert_array_equal(out, mlp_output)
  
file_path: garage/tests/garage/tf/models/test_cnn_mlp_merge_model.py
imports: import pickle
  import numpy
  import pytest
  import tensorflow
  from garage.tf.models import CNNMLPMergeModel
  from tests.fixtures import TfGraphTestCase
label_desc: Use image node_id 3 for calling the TestCNNMLPMergeModel obj's underlying member method code with example usage: obj.test_output_value_max_pooling(filters, in_channels, strides, pool_strides, pool_shapes) without return types