Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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'))
Ejemplo n.º 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'))
Ejemplo n.º 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"))
Ejemplo n.º 6
0
 def testGetVariableThrowsExceptionWithNoMatch(self):
     var_name = 'cant_find_me'
     with self.test_session():
         with self.assertRaises(ValueError):
             variables.get_unique_variable(var_name)
Ejemplo n.º 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'))
Ejemplo n.º 8
0
 def testGetVariableThrowsExceptionWithNoMatch(self):
   var_name = 'cant_find_me'
   with self.test_session():
     with self.assertRaises(ValueError):
       variables.get_unique_variable(var_name)
Ejemplo n.º 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'))