Exemple #1
0
 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)
Exemple #2
0
 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)
Exemple #3
0
 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'))
Exemple #4
0
 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'))
Exemple #5
0
 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"))
Exemple #6
0
 def testGetVariableThrowsExceptionWithNoMatch(self):
     var_name = 'cant_find_me'
     with self.test_session():
         with self.assertRaises(ValueError):
             variables.get_unique_variable(var_name)
Exemple #7
0
 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'))
Exemple #8
0
 def testGetVariableThrowsExceptionWithNoMatch(self):
   var_name = 'cant_find_me'
   with self.test_session():
     with self.assertRaises(ValueError):
       variables.get_unique_variable(var_name)
Exemple #9
0
 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'))