Esempio n. 1
0
 def testScopeStringFromParamsUnsupportedType(self):
     with tf.Graph().as_default():
         x = tf.constant(1, )
         y = tf.constant(2, )
         unsupported = 1.2  # Floats are not supported.
         with self.assertRaises(ValueError):
             ff.scope_string_from_params([[1, 2, 3], 'foo', True, 4, (x, y),
                                          unsupported])
Esempio n. 2
0
 def testScopeStringFromParamsMultipleTypes(self):
     with tf.Graph().as_default():
         x = tf.constant(1, )
         y = tf.constant(2, )
         scope_string = ff.scope_string_from_params([[1, 2, 3], 'foo', True,
                                                     4, (x, y)])
         self.assertEqual('1-2-3_foo_True_4_Const__Const_1', scope_string)
Esempio n. 3
0
 def testScopeStringFromParamsMultipleTensors(self):
     with tf.Graph().as_default():
         x = tf.constant(1, )
         y = tf.constant(2, )
         scope_string = ff.scope_string_from_params((x, y))
         self.assertEqual('Const_Const_1', scope_string)
Esempio n. 4
0
 def testScopeStringFromParamsSingleTensor(self):
     with tf.Graph().as_default():
         g = self._make_tensor()
         scope_string = ff.scope_string_from_params(g)
         self.assertEqual('gradients_MatMul_grad_MatMul_1', scope_string)