Ejemplo n.º 1
0
 def testCreateMaxPooling1D(self):
     width = 7
     channels = 3
     images = tf.random.uniform((5, width, channels))
     layer = pooling_layers.MaxPooling1D(2, strides=2)
     output = layer(images)
     self.assertListEqual(output.get_shape().as_list(),
                          [5, width // 2, channels])
Ejemplo n.º 2
0
 def testCreateMaxPooling1DChannelsFirst(self):
   width = 7
   channels = 3
   images = tf.random.uniform((5, channels, width))
   layer = pooling_layers.MaxPooling1D(
       2, strides=2, data_format='channels_first')
   output = layer(images)
   self.assertListEqual(output.get_shape().as_list(),
                        [5, channels, width // 2])