本文整理汇总了Python中inception.slim.variables.get_unique_variable方法的典型用法代码示例。如果您正苦于以下问题:Python variables.get_unique_variable方法的具体用法?Python variables.get_unique_variable怎么用?Python variables.get_unique_variable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类inception.slim.variables
的用法示例。
在下文中一共展示了variables.get_unique_variable方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testGetVariableWithSingleVar
# 需要导入模块: from inception.slim import variables [as 别名]
# 或者: from inception.slim.variables import get_unique_variable [as 别名]
def testGetVariableWithSingleVar(self):
with self.test_session():
with tf.variable_scope('parent'):
a = variables.variable('child', [5])
self.assertEquals(a, variables.get_unique_variable('parent/child'))
示例2: testGetVariableWithDistractors
# 需要导入模块: from inception.slim import variables [as 别名]
# 或者: from inception.slim.variables import get_unique_variable [as 别名]
def testGetVariableWithDistractors(self):
with self.test_session():
with tf.variable_scope('parent'):
a = variables.variable('child', [5])
with tf.variable_scope('child'):
variables.variable('grandchild1', [7])
variables.variable('grandchild2', [9])
self.assertEquals(a, variables.get_unique_variable('parent/child'))
示例3: testGetVariableThrowsExceptionWithNoMatch
# 需要导入模块: from inception.slim import variables [as 别名]
# 或者: from inception.slim.variables import get_unique_variable [as 别名]
def testGetVariableThrowsExceptionWithNoMatch(self):
var_name = 'cant_find_me'
with self.test_session():
with self.assertRaises(ValueError):
variables.get_unique_variable(var_name)
示例4: testGetThrowsExceptionWithChildrenButNoMatch
# 需要导入模块: from inception.slim import variables [as 别名]
# 或者: from inception.slim.variables import get_unique_variable [as 别名]
def testGetThrowsExceptionWithChildrenButNoMatch(self):
var_name = 'parent/child'
with self.test_session():
with tf.variable_scope(var_name):
variables.variable('grandchild1', [7])
variables.variable('grandchild2', [9])
with self.assertRaises(ValueError):
variables.get_unique_variable(var_name)