TST: add unit test
This commit is contained in:
parent
0563e1f6bf
commit
0c9ddf3ffd
@ -314,6 +314,16 @@ class TensorUtilTest(test.TestCase):
|
||||
shape=[3, 4],
|
||||
dtype=dtype)))
|
||||
|
||||
def testIntMixedWithDimension(self):
|
||||
dtype = dtypes.int32
|
||||
nptype = np.int32
|
||||
t = tensor_util.make_tensor_proto([10, tensor_shape.Dimension(20), 30],
|
||||
dtype=dtype)
|
||||
self.assertEquals(dtype, t.dtype)
|
||||
a = tensor_util.MakeNdarray(t)
|
||||
self.assertEquals(nptype, a.dtype)
|
||||
self.assertAllClose(np.array([10, 20, 30], dtype=nptype), a)
|
||||
|
||||
def testLong(self):
|
||||
t = tensor_util.make_tensor_proto(10, dtype=dtypes.int64)
|
||||
self.assertProtoEquals("""
|
||||
|
Loading…
Reference in New Issue
Block a user