Example #1
0
 def test_tensor_fields(self):
     t = self.t
     shape = self.shape
     self.assertTupleEqual(t.shape, shape)
     self.assertEqual(t.shape[0], shape[0])
     self.assertEqual(t.shape[1], shape[1])
     self.assertEqual(tensor.product(shape), 2 * 3)
     self.assertEqual(t.ndim(), 2)
     self.assertEqual(t.size(), 2 * 3)
     self.assertEqual(t.memsize(), 2 * 3 * tensor.sizeof(core_pb2.kFloat32))
     self.assertFalse(t.is_transpose())
Example #2
0
 def test_tensor_fields(self):
     t = self.t
     shape = self.shape
     self.assertTupleEqual(t.shape, shape)
     self.assertEqual(t.shape[0], shape[0])
     self.assertEqual(t.shape[1], shape[1])
     self.assertEqual(tensor.product(shape), 2*3)
     self.assertEqual(t.ndim(), 2)
     self.assertEqual(t.size(), 2*3)
     self.assertEqual(t.memsize(), 2*3*tensor.sizeof(core_pb2.kFloat32))
     self.assertFalse(t.is_transpose())