code: def test_output_shape_valid(self, filters, strides):
      with tf.compat.v1.variable_scope("CNN"):
          self.cnn = cnn(
              input_var=self._input_ph,
              input_dim=self.input_dim,
              filters=filters,
              strides=strides,
              name="cnn",
              padding="VALID",
              hidden_w_init=tf.constant_initializer(1),
              hidden_nonlinearity=self.hidden_nonlinearity,
          )
  
      self.sess.run(tf.compat.v1.global_variables_initializer())
  
      result = self.sess.run(
          self.cnn, feed_dict={self._input_ph: self.obs_input}
      )
  
      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
          )
          width_size = (
              int((width_size - filter_iter[1][1]) / stride) + 1
          )
      flatten_shape = height_size * width_size * filters[-1][0]
      assert result.shape == (self.batch_size, flatten_shape)
  
file_path: garage/tests/garage/tf/models/test_cnn.py
imports: import numpy
  import pytest
  import tensorflow
  from garage.tf.models.cnn import cnn, cnn_with_max_pooling
  from tests.fixtures import TfGraphTestCase
  from tests.helpers import convolve, max_pooling
label_desc: Use image node_id 3 for calling the TestCNN obj's underlying member method code with example usage: obj.test_output_shape_valid(filters, strides) without return types