本文整理匯總了Python中inception.slim.ops.avg_pool方法的典型用法代碼示例。如果您正苦於以下問題:Python ops.avg_pool方法的具體用法?Python ops.avg_pool怎麽用?Python ops.avg_pool使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類inception.slim.ops
的用法示例。
在下文中一共展示了ops.avg_pool方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: testCreateAvgPool
# 需要導入模塊: from inception.slim import ops [as 別名]
# 或者: from inception.slim.ops import avg_pool [as 別名]
def testCreateAvgPool(self):
height, width = 3, 3
with self.test_session():
images = tf.random_uniform((5, height, width, 3), seed=1)
output = ops.avg_pool(images, [3, 3])
self.assertEquals(output.op.name, 'AvgPool/AvgPool')
self.assertListEqual(output.get_shape().as_list(), [5, 1, 1, 3])
示例2: testCreateSquareAvgPool
# 需要導入模塊: from inception.slim import ops [as 別名]
# 或者: from inception.slim.ops import avg_pool [as 別名]
def testCreateSquareAvgPool(self):
height, width = 3, 3
with self.test_session():
images = tf.random_uniform((5, height, width, 3), seed=1)
output = ops.avg_pool(images, 3)
self.assertEquals(output.op.name, 'AvgPool/AvgPool')
self.assertListEqual(output.get_shape().as_list(), [5, 1, 1, 3])
示例3: testCreateAvgPoolWithScope
# 需要導入模塊: from inception.slim import ops [as 別名]
# 或者: from inception.slim.ops import avg_pool [as 別名]
def testCreateAvgPoolWithScope(self):
height, width = 3, 3
with self.test_session():
images = tf.random_uniform((5, height, width, 3), seed=1)
output = ops.avg_pool(images, [3, 3], scope='pool1')
self.assertEquals(output.op.name, 'pool1/AvgPool')
示例4: testCreateAvgPoolSAME
# 需要導入模塊: from inception.slim import ops [as 別名]
# 或者: from inception.slim.ops import avg_pool [as 別名]
def testCreateAvgPoolSAME(self):
height, width = 3, 3
with self.test_session():
images = tf.random_uniform((5, height, width, 3), seed=1)
output = ops.avg_pool(images, [3, 3], padding='SAME')
self.assertListEqual(output.get_shape().as_list(), [5, 2, 2, 3])
示例5: testCreateAvgPoolStrideSAME
# 需要導入模塊: from inception.slim import ops [as 別名]
# 或者: from inception.slim.ops import avg_pool [as 別名]
def testCreateAvgPoolStrideSAME(self):
height, width = 3, 3
with self.test_session():
images = tf.random_uniform((5, height, width, 3), seed=1)
output = ops.avg_pool(images, [3, 3], stride=1, padding='SAME')
self.assertListEqual(output.get_shape().as_list(), [5, height, width, 3])