예제 #1
0
 def testCreateSquareMaxPool(self):
   height, width = 3, 3
   with self.test_session():
     images = tf.random_uniform((5, height, width, 3), seed=1)
     output = ops.max_pool(images, 3)
     self.assertEquals(output.op.name, 'MaxPool/MaxPool')
     self.assertListEqual(output.get_shape().as_list(), [5, 1, 1, 3])
예제 #2
0
 def testGlobalMaxPool(self):
   height, width = 3, 3
   with self.test_session():
     images = tf.random_uniform((5, height, width, 3), seed=1)
     output = ops.max_pool(images, images.get_shape()[1:3], stride=1)
     self.assertListEqual(output.get_shape().as_list(), [5, 1, 1, 3])
예제 #3
0
 def testCreateMaxPoolStrideSAME(self):
   height, width = 3, 3
   with self.test_session():
     images = tf.random_uniform((5, height, width, 3), seed=1)
     output = ops.max_pool(images, [3, 3], stride=1, padding='SAME')
     self.assertListEqual(output.get_shape().as_list(), [5, height, width, 3])
예제 #4
0
 def testCreateMaxPoolWithScope(self):
   height, width = 3, 3
   with self.test_session():
     images = tf.random_uniform((5, height, width, 3), seed=1)
     output = ops.max_pool(images, [3, 3], scope='pool1')
     self.assertEquals(output.op.name, 'pool1/MaxPool')