Esempio n. 1
0
 def testMakeAttrShape(self):
     for s in ([], None, [1, 2, 3], [None, None], [1, None, 3]):
         expected = tensor_shape.TensorShape(s).as_proto()
         actual = backprop.make_attr(pywrap_tensorflow.TF_ATTR_SHAPE, s)
         self.assertEqual(expected,
                          actual,
                          msg=('For shape %r, expected %r != %r actual' %
                               (s, expected, actual)))
Esempio n. 2
0
 def testMakeAttrShape(self):
   for s in ([], None, [1, 2, 3], [None, None], [1, None, 3]):
     expected = tensor_shape.TensorShape(s).as_proto()
     actual = backprop.make_attr(pywrap_tensorflow.TF_ATTR_SHAPE, s)
     self.assertEqual(
         expected,
         actual,
         msg=('For shape %r, expected %r != %r actual' % (s, expected,
                                                          actual)))
Esempio n. 3
0
 def testMakeAttrShapeList(self):
     shape_list = [[], None, [1, 2, 3], [None, None], [1, None, 3]]
     self.assertEqual(
         [tensor_shape.TensorShape(s).as_proto() for s in shape_list],
         backprop.make_attr([pywrap_tensorflow.TF_ATTR_SHAPE], shape_list))
Esempio n. 4
0
 def testMakeAttrTypeList(self):
     self.assertEqual([dtypes.float32],
                      backprop.make_attr([pywrap_tensorflow.TF_ATTR_TYPE],
                                         [1]))
Esempio n. 5
0
 def testMakeAttrType(self):
     self.assertEqual(dtypes.float32,
                      backprop.make_attr(pywrap_tensorflow.TF_ATTR_TYPE, 1))
Esempio n. 6
0
 def testMakeAttrShapeList(self):
   shape_list = [[], None, [1, 2, 3], [None, None], [1, None, 3]]
   self.assertEqual(
       [tensor_shape.TensorShape(s).as_proto() for s in shape_list],
       backprop.make_attr([pywrap_tensorflow.TF_ATTR_SHAPE], shape_list))
Esempio n. 7
0
 def testMakeAttrTypeList(self):
   self.assertEqual([dtypes.float32],
                    backprop.make_attr([pywrap_tensorflow.TF_ATTR_TYPE], [1]))
Esempio n. 8
0
 def testMakeAttrType(self):
   self.assertEqual(dtypes.float32,
                    backprop.make_attr(pywrap_tensorflow.TF_ATTR_TYPE, 1))