本文整理匯總了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)