def testFullyConvWithCustomGetter(self):
height, width = 7, 9
with self.test_session():
called = [0]
def custom_getter(getter, *args, **kwargs):
called[0] += 1
return getter(*args, **kwargs)
with variable_scope.variable_scope('test', custom_getter=custom_getter):
images = random_ops.random_uniform((5, height, width, 32), seed=1)
layers_lib.convolution2d(images, 64, images.get_shape()[1:3])
self.assertEqual(called[0], 2) # Custom getter called twice.
layers_test.py 文件源码
python
阅读 19
收藏 0
点赞 0
评论 0
评论列表
文章目录