本文整理汇总了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])