MCPcopy Create free account
hub / github.com/apache/singa / test_tensor_fields

Method test_tensor_fields

test/python/test_tensor.py:41–51  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

39 self.s.set_value(0)
40
41 def test_tensor_fields(self):
42 t = self.t
43 shape = self.shape
44 self.assertTupleEqual(t.shape, shape)
45 self.assertEqual(t.shape[0], shape[0])
46 self.assertEqual(t.shape[1], shape[1])
47 self.assertEqual(tensor.product(shape), 2 * 3)
48 self.assertEqual(t.ndim(), 2)
49 self.assertEqual(t.size(), 2 * 3)
50 self.assertEqual(t.memsize(), 2 * 3 * tensor.sizeof(tensor.float32))
51 self.assertFalse(t.is_transpose())
52
53 def test_unary_operators(self):
54 t = self.t

Callers

nothing calls this directly

Calls 4

ndimMethod · 0.45
sizeMethod · 0.45
memsizeMethod · 0.45
is_transposeMethod · 0.45

Tested by

no test coverage detected