|
|
|
@ -14,14 +14,13 @@
|
|
|
|
|
# ============================================================================
|
|
|
|
|
"""multitype_ops directory test case"""
|
|
|
|
|
import numpy as np
|
|
|
|
|
from functools import partial, reduce
|
|
|
|
|
import pytest
|
|
|
|
|
|
|
|
|
|
import mindspore.nn as nn
|
|
|
|
|
from mindspore import Tensor
|
|
|
|
|
from mindspore import dtype as mstype
|
|
|
|
|
from mindspore.ops import functional as F, composite as C
|
|
|
|
|
from mindspore.ops import functional as F
|
|
|
|
|
import mindspore.context as context
|
|
|
|
|
import pytest
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class TensorIntAutoCast(nn.Cell):
|
|
|
|
@ -65,7 +64,7 @@ class TensorAutoCast(nn.Cell):
|
|
|
|
|
|
|
|
|
|
def test_tensor_auto_cast():
|
|
|
|
|
context.set_context(mode=context.GRAPH_MODE)
|
|
|
|
|
t0 = Tensor([True, False], mstype.bool_)
|
|
|
|
|
Tensor([True, False], mstype.bool_)
|
|
|
|
|
t_uint8 = Tensor(np.ones([2, 1, 2, 2]), mstype.uint8)
|
|
|
|
|
t_int8 = Tensor(np.ones([2, 1, 2, 2]), mstype.int8)
|
|
|
|
|
t_int16 = Tensor(np.ones([2, 1, 2, 2]), mstype.int16)
|
|
|
|
|