|
@@ -28,3 +28,10 @@ def test_as_raw_tensor_from_int64(): |
|
|
assert xx.dtype == np.float32 |
|
|
assert xx.dtype == np.float32 |
|
|
assert xx.device == "xpux" |
|
|
assert xx.device == "xpux" |
|
|
np.testing.assert_almost_equal(yy, x.astype("float32") + 1) |
|
|
np.testing.assert_almost_equal(yy, x.astype("float32") + 1) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_as_raw_tensor_uint16(): |
|
|
|
|
|
x = np.arange(6, dtype="uint16").reshape(2, 3) |
|
|
|
|
|
xx = Tensor(x, device="xpux") |
|
|
|
|
|
assert xx.dtype == np.uint16 |
|
|
|
|
|
assert xx.device == "xpux" |