forked from mindspore-Ecosystem/mindspore
!35316 gpu_testcase_level_adjust
Merge pull request !35316 from LLLRT/master
This commit is contained in:
commit
06824b4a2e
|
@ -44,7 +44,7 @@ def test_train_with_Ascend():
|
|||
test_train("Ascend")
|
||||
|
||||
@security_off_wrap
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_train_with_GPU():
|
||||
|
|
|
@ -29,7 +29,7 @@ from tests.models.official.cv.mobilenetv2.src.mobilenetV2 import MobileNetV2Back
|
|||
context.set_context(mode=context.GRAPH_MODE, device_target="GPU")
|
||||
ckpt_path = '/home/workspace/mindspore_dataset/checkpoint/mobilenetv2/mobilenetv2_gpu.ckpt'
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_export_mobilenetv2_gpu_mindir():
|
||||
|
|
|
@ -68,7 +68,7 @@ class AlexNet(nn.Cell):
|
|||
return x
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_trainTensor(num_classes=10, epoch=15, batch_size=32):
|
||||
|
|
|
@ -127,7 +127,7 @@ def multisteplr(total_steps, gap, base_lr=0.9, gamma=0.1, dtype=mstype.float32):
|
|||
return Tensor(np.array(lr), dtype)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_train_lenet():
|
||||
|
|
|
@ -31,7 +31,7 @@ def test_train_and_eval():
|
|||
test_train_and_eval_lenet()
|
||||
|
||||
@security_off_wrap
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_train_with_GPU():
|
||||
|
|
|
@ -105,7 +105,7 @@ class SentimentNet(nn.Cell):
|
|||
batch_size = 64
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_LSTM():
|
||||
|
|
|
@ -328,7 +328,7 @@ def resnet50(num_classes):
|
|||
return ResNet(ResidualBlock, [3, 4, 6, 3], num_classes)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_trainTensor(num_classes=10, epoch=8, batch_size=1):
|
||||
|
|
|
@ -1252,7 +1252,7 @@ def test_select():
|
|||
match_res(mnp.select, onp.select, condlist, choicelist, default=10)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.platform_x86_cpu
|
||||
@pytest.mark.env_onecard
|
||||
|
|
|
@ -274,7 +274,7 @@ def test_isscalar():
|
|||
assert mnp.isscalar('numpy') == onp.isscalar('numpy')
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.platform_x86_cpu
|
||||
@pytest.mark.env_onecard
|
||||
|
|
|
@ -1733,7 +1733,7 @@ def onp_convolve(mode):
|
|||
return a, b, c, d, e
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_convolve():
|
||||
|
@ -2659,7 +2659,7 @@ def onp_correlate(a, v):
|
|||
return a, b, c, d
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_correlate():
|
||||
|
|
|
@ -75,7 +75,7 @@ def test_tensor_copy_slices():
|
|||
test_tensor_copy_slices_net_many_dtype((10, 10, 10), (5, 10), (9, 5,), (10, 10,), (1, 1,), support_dtype)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_tensor_copy_slices_bprop():
|
||||
|
@ -105,14 +105,14 @@ def test_tensor_copy_slices_ascend_pynative():
|
|||
context.set_context(mode=context.PYNATIVE_MODE, device_target="Ascend")
|
||||
test_tensor_copy_slices()
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_tensor_copy_slices_gpu_graph():
|
||||
context.set_context(mode=context.GRAPH_MODE, device_target="GPU")
|
||||
test_tensor_copy_slices()
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_tensor_copy_slices_gpu_pynative():
|
||||
|
|
|
@ -45,7 +45,7 @@ class Grad(nn.Cell):
|
|||
return self.grad(self.network)(x, grad, dout)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
@pytest.mark.parametrize("fp_type, error_magnitude, mode", [
|
||||
|
|
|
@ -21,7 +21,7 @@ from mindspore import Tensor
|
|||
import mindspore.ops.operations._grad_ops as P
|
||||
context.set_context(mode=context.PYNATIVE_MODE, device_target="GPU")
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_acosgrad_fp32():
|
||||
|
@ -33,7 +33,7 @@ def test_acosgrad_fp32():
|
|||
diff = output_ms.asnumpy() - expect
|
||||
assert np.all(diff < error)
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_acosgrad_fp16():
|
||||
|
|
|
@ -21,7 +21,7 @@ from mindspore import Tensor
|
|||
from mindspore.ops import operations as P
|
||||
context.set_context(mode=context.PYNATIVE_MODE, device_target="GPU")
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_acos_fp32():
|
||||
|
@ -30,7 +30,7 @@ def test_acos_fp32():
|
|||
output_np = np.arccos(x_np)
|
||||
assert np.allclose(output_ms.asnumpy(), output_np)
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_acos_fp16():
|
||||
|
|
|
@ -72,14 +72,14 @@ def acosh_grad_grad_base(dtype, loss):
|
|||
assert np.allclose(dgrad_ms.asnumpy(), dgrad_np, loss, loss)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_acosh_grad_grad_float16():
|
||||
acosh_grad_grad_base(np.float16, 2e-3)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_acosh_grad_grad_float32():
|
||||
|
|
|
@ -22,7 +22,7 @@ import mindspore.ops.operations._grad_ops as P
|
|||
context.set_context(mode=context.PYNATIVE_MODE, device_target="GPU")
|
||||
np.random.seed(1)
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_acoshgrad_fp32():
|
||||
|
@ -32,7 +32,7 @@ def test_acoshgrad_fp32():
|
|||
output_np = dout_np / np.sinh(y_np)
|
||||
assert np.allclose(output_ms.asnumpy(), output_np, 1e-4, 1e-4)
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_acoshgrad_fp16():
|
||||
|
|
|
@ -22,7 +22,7 @@ from mindspore.ops import operations as P
|
|||
context.set_context(mode=context.PYNATIVE_MODE, device_target="GPU")
|
||||
np.random.seed(1)
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_acosh_fp32():
|
||||
|
@ -31,7 +31,7 @@ def test_acosh_fp32():
|
|||
output_np = np.arccosh(x_np)
|
||||
assert np.allclose(output_ms.asnumpy(), output_np, 1e-4, 1e-4)
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_acosh_fp16():
|
||||
|
|
|
@ -40,7 +40,7 @@ class Net(nn.Cell):
|
|||
return z
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_apply_adagrad():
|
||||
|
|
|
@ -65,7 +65,7 @@ class Net(nn.Cell):
|
|||
return next_v
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_adam_fusion():
|
||||
|
|
|
@ -41,7 +41,7 @@ class NetAdam(nn.Cell):
|
|||
return output
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_adam():
|
||||
|
|
|
@ -47,7 +47,7 @@ class GradNet(nn.Cell):
|
|||
return self.adaptive_avg_pool2d_grad(x, dy)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_net_normal():
|
||||
|
@ -58,7 +58,7 @@ def test_net_normal():
|
|||
assert output.asnumpy().shape == expect_shape
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_net_single():
|
||||
|
@ -69,7 +69,7 @@ def test_net_single():
|
|||
assert output.asnumpy().shape == expect_shape
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_net_none():
|
||||
|
@ -80,7 +80,7 @@ def test_net_none():
|
|||
assert output.asnumpy().shape == expect_shape
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_net_value():
|
||||
|
|
|
@ -129,7 +129,7 @@ def add(nptype):
|
|||
|
||||
|
||||
@pytest.mark.skip(reason='0 in shape is not support')
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_add_float64():
|
||||
|
@ -137,7 +137,7 @@ def test_add_float64():
|
|||
|
||||
|
||||
@pytest.mark.skip(reason='0 in shape is not support')
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_add_float32():
|
||||
|
|
|
@ -33,7 +33,7 @@ class Net(nn.Cell):
|
|||
return self.add((x, y, z))
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_net():
|
||||
|
@ -56,7 +56,7 @@ def test_net():
|
|||
assert (output.asnumpy() == expect_result).all()
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_net_float64():
|
||||
|
@ -95,7 +95,7 @@ def test_net_float64():
|
|||
assert (output.asnumpy() == expect_result).all()
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_net_int64():
|
||||
|
|
|
@ -32,7 +32,7 @@ class Net(nn.Cell):
|
|||
return self.apply_gradient_descent(self.var, alpha, delta)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_apply_gradient_descent_float32():
|
||||
|
@ -59,7 +59,7 @@ def test_apply_gradient_descent_float32():
|
|||
np.testing.assert_almost_equal(net.var.asnumpy(), expect)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_apply_gradient_descent_float16():
|
||||
|
|
|
@ -34,7 +34,7 @@ class NetArgmax(nn.Cell):
|
|||
return self.argmax(x)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_argmax_1d():
|
||||
|
@ -48,7 +48,7 @@ def test_argmax_1d():
|
|||
assert (output.asnumpy() == expect).all()
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_argmax_2d():
|
||||
|
|
|
@ -101,21 +101,21 @@ def argmaxwithvalue_3d(data_type, shape_x):
|
|||
assert (output[1].asnumpy() == expect2).all()
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_argmaxwithvalue_base_float32():
|
||||
argmaxwithvalue_base(np.float32)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_argmaxwithvalue_base_float16():
|
||||
argmaxwithvalue_base(np.float16)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_argmaxwithvalue_3d_float32():
|
||||
|
@ -126,7 +126,7 @@ def test_argmaxwithvalue_3d_float32():
|
|||
argmaxwithvalue_3d(np.float32, shape_x)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_argmaxwithvalue_3d_float16():
|
||||
|
@ -135,7 +135,7 @@ def test_argmaxwithvalue_3d_float16():
|
|||
argmaxwithvalue_3d(np.float16, shape_x)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_argmaxwithvalue_3d_big_float32():
|
||||
|
|
|
@ -101,21 +101,21 @@ def argminwithvalue_3d(data_type, shape_x):
|
|||
assert (output[1].asnumpy() == expect2).all()
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_argminwithvalue_base_float32():
|
||||
argminwithvalue_base(np.float32)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_argminwithvalue_base_float16():
|
||||
argminwithvalue_base(np.float16)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_argminwithvalue_3d_float32():
|
||||
|
@ -126,7 +126,7 @@ def test_argminwithvalue_3d_float32():
|
|||
argminwithvalue_3d(np.float32, shape_x)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_argminwithvalue_3d_float16():
|
||||
|
@ -135,7 +135,7 @@ def test_argminwithvalue_3d_float16():
|
|||
argminwithvalue_3d(np.float16, shape_x)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_argminwithvalue_3d_big_float32():
|
||||
|
|
|
@ -45,7 +45,7 @@ class Grad(nn.Cell):
|
|||
return self.grad(self.network)(x, grad, dout)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
@pytest.mark.parametrize("fp_type, error_magnitude, mode", [
|
||||
|
|
|
@ -21,7 +21,7 @@ from mindspore import Tensor
|
|||
import mindspore.ops.operations._grad_ops as P
|
||||
context.set_context(mode=context.PYNATIVE_MODE, device_target="GPU")
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_asingrad_fp32():
|
||||
|
@ -33,7 +33,7 @@ def test_asingrad_fp32():
|
|||
diff = output_ms.asnumpy() - expect
|
||||
assert np.all(diff < error)
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_asingrad_fp16():
|
||||
|
|
|
@ -21,7 +21,7 @@ from mindspore import Tensor
|
|||
from mindspore.ops import operations as P
|
||||
context.set_context(mode=context.PYNATIVE_MODE, device_target="GPU")
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_asin_fp32():
|
||||
|
@ -30,7 +30,7 @@ def test_asin_fp32():
|
|||
output_np = np.arcsin(x_np)
|
||||
assert np.allclose(output_ms.asnumpy(), output_np)
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_asin_fp16():
|
||||
|
|
|
@ -72,14 +72,14 @@ def asinh_grad_grad_base(dtype, loss):
|
|||
assert np.allclose(dgrad_ms.asnumpy(), dgrad_np, loss, loss)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_asinh_grad_grad_float16():
|
||||
asinh_grad_grad_base(np.float16, 1e-3)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_asinh_grad_grad_float32():
|
||||
|
|
|
@ -22,7 +22,7 @@ import mindspore.ops.operations._grad_ops as P
|
|||
context.set_context(mode=context.PYNATIVE_MODE, device_target="GPU")
|
||||
np.random.seed(1)
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_asinhgrad_fp32():
|
||||
|
|
|
@ -22,7 +22,7 @@ from mindspore.ops import operations as P
|
|||
context.set_context(mode=context.PYNATIVE_MODE, device_target="GPU")
|
||||
np.random.seed(1)
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_asinh_fp32():
|
||||
|
@ -31,7 +31,7 @@ def test_asinh_fp32():
|
|||
output_np = np.arcsinh(x_np)
|
||||
assert np.allclose(output_ms.asnumpy(), output_np, 1e-4, 1e-4)
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_asinh_fp16():
|
||||
|
|
|
@ -33,7 +33,7 @@ class AssignAdd(nn.Cell):
|
|||
return res
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_assign_add():
|
||||
|
|
|
@ -36,7 +36,7 @@ x = np.array([[1.2, 1], [1, 0]]).astype(np.float32)
|
|||
value = np.array([[1, 2], [3, 4.0]]).astype(np.float32)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_assign():
|
||||
|
@ -54,7 +54,7 @@ def test_assign():
|
|||
assert np.all(-diff2 < error)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_assign_float64():
|
||||
|
|
|
@ -73,14 +73,14 @@ def atan_grad_grad_base(dtype, loss):
|
|||
assert np.allclose(dgrad_ms.asnumpy(), dgrad_np, loss, loss)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_atan_grad_grad_float16():
|
||||
atan_grad_grad_base(np.float16, 1e-3)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_atan_grad_grad_float32():
|
||||
|
|
|
@ -22,7 +22,7 @@ import mindspore.ops.operations._grad_ops as P
|
|||
context.set_context(mode=context.PYNATIVE_MODE, device_target="GPU")
|
||||
np.random.seed(1)
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_atangrad_fp32():
|
||||
|
@ -32,7 +32,7 @@ def test_atangrad_fp32():
|
|||
output_np = dout_np / (1 + np.square(x_np))
|
||||
assert np.allclose(output_ms.asnumpy(), output_np, 1e-4, 1e-4)
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_atangrad_fp16():
|
||||
|
|
|
@ -22,7 +22,7 @@ from mindspore.ops import operations as P
|
|||
context.set_context(mode=context.PYNATIVE_MODE, device_target="GPU")
|
||||
np.random.seed(1)
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_atan_fp32():
|
||||
|
@ -31,7 +31,7 @@ def test_atan_fp32():
|
|||
output_np = np.arctan(x_np)
|
||||
assert np.allclose(output_ms.asnumpy(), output_np, 1e-4, 1e-4)
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_atan_fp16():
|
||||
|
|
|
@ -32,7 +32,7 @@ class BatchMatMulNet(nn.Cell):
|
|||
def construct(self, x, y):
|
||||
return self.batch_matmul(x, y)
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_4d():
|
||||
|
@ -54,7 +54,7 @@ def test_4d():
|
|||
assert (output.asnumpy() == expect).all()
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_4d_float64():
|
||||
|
@ -76,7 +76,7 @@ def test_4d_float64():
|
|||
assert (output.asnumpy() == expect).all()
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_4d_transpose_a():
|
||||
|
@ -98,7 +98,7 @@ def test_4d_transpose_a():
|
|||
assert (output.asnumpy() == expect).all()
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_4d_transpose_b():
|
||||
|
@ -120,7 +120,7 @@ def test_4d_transpose_b():
|
|||
assert (output.asnumpy() == expect).all()
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_4d_transpose_ab():
|
||||
|
@ -142,7 +142,7 @@ def test_4d_transpose_ab():
|
|||
assert (output.asnumpy() == expect).all()
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_4D_fp16():
|
||||
|
@ -176,7 +176,7 @@ class BatchMatMul_d(nn.Cell):
|
|||
return self.batch_matmul(x, y)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_batchmatmul_dynamic():
|
||||
|
|
|
@ -52,7 +52,7 @@ class Net_gnd(nn.Cell):
|
|||
return out
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_batchnrom_fold2():
|
||||
|
|
|
@ -43,7 +43,7 @@ def np_result(d_batch_mean, d_batch_std, x, batch_mean, batch_std):
|
|||
return dx
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_batchnorm_fold_grad1():
|
||||
|
@ -61,7 +61,7 @@ def test_batchnorm_fold_grad1():
|
|||
assert np.allclose(dx.asnumpy(), expect, rtol=1.e-7, atol=1.e-7)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_batchnorm_fold_grad2():
|
||||
|
@ -79,7 +79,7 @@ def test_batchnorm_fold_grad2():
|
|||
assert np.allclose(dx.asnumpy(), expect, rtol=1.e-7, atol=1.e-7)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_batchnorm_fold_grad_freeze():
|
||||
|
|
|
@ -52,7 +52,7 @@ def np_result(x, mean, var, momentum, epsilon):
|
|||
return np_mean, np_var, mean_update, var_update, delay_mean, delay_std
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_batchnorm_fold():
|
||||
|
@ -77,7 +77,7 @@ def test_batchnorm_fold():
|
|||
assert np.allclose(delay_std.asnumpy(), expect6, rtol=1.e-7, atol=1.e-5)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_batchnorm_fold2():
|
||||
|
@ -100,7 +100,7 @@ def test_batchnorm_fold2():
|
|||
assert np.allclose(delay_std.asnumpy(), expect6, rtol=1.e-7, atol=1.e-5)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_batchnorm_fold_freeze():
|
||||
|
|
|
@ -47,7 +47,7 @@ class Grad(Cell):
|
|||
return gout
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_train_forward():
|
||||
|
@ -101,7 +101,7 @@ def test_train_forward():
|
|||
output = bn_net(Tensor(x))
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_train_backward():
|
||||
|
@ -137,7 +137,7 @@ def test_train_backward():
|
|||
assert np.all(-diff < error)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_train_stats_false_forward():
|
||||
|
@ -181,7 +181,7 @@ def test_train_stats_false_forward():
|
|||
assert np.all(-diff < error)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_infer_backward():
|
||||
|
@ -229,7 +229,7 @@ class GradByListNet(Cell):
|
|||
return output
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_1d_train():
|
||||
|
@ -298,7 +298,7 @@ def test_1d_train():
|
|||
assert np.allclose(bn_net.bn1.moving_variance.asnumpy(), data[6], atol=1.0e-4)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_1d_eval():
|
||||
|
|
|
@ -32,7 +32,7 @@ class Net(nn.Cell):
|
|||
return self.loss(predict, target, weight, pos_weight)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_reduction_none_testcases():
|
||||
|
@ -70,7 +70,7 @@ def test_reduction_none_testcases():
|
|||
np.testing.assert_almost_equal(expected, output.asnumpy(), decimal=3)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_reduction_mean_testcases():
|
||||
|
|
|
@ -34,7 +34,7 @@ class Net(nn.Cell):
|
|||
return self.BinaryCrossEntropy(x, y, weight)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_binary_cross_entropy_loss():
|
||||
|
@ -73,7 +73,7 @@ class Grad(nn.Cell):
|
|||
return gout
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_binary_cross_entropy_loss_grad():
|
||||
|
|
|
@ -32,7 +32,7 @@ class NetBoundingBoxDecode(nn.Cell):
|
|||
def construct(self, anchor, groundtruth):
|
||||
return self.decode(anchor, groundtruth)
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_boundingbox_decode():
|
||||
|
|
|
@ -53,7 +53,7 @@ def bbox2delta(proposals, gt, means, stds):
|
|||
|
||||
return deltas
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_boundingbox_encode():
|
||||
|
|
|
@ -21,7 +21,7 @@ from mindspore.common.tensor import Tensor
|
|||
from mindspore.ops import operations as P
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_nobroadcast():
|
||||
|
@ -92,7 +92,7 @@ def test_nobroadcast():
|
|||
assert np.allclose(output_ms.asnumpy(), output_np)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_nobroadcast_fp16():
|
||||
|
@ -155,7 +155,7 @@ def test_nobroadcast_fp16():
|
|||
assert np.allclose(output_ms.asnumpy(), output_np)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_broadcast():
|
||||
|
@ -226,7 +226,7 @@ def test_broadcast():
|
|||
assert np.allclose(output_ms.asnumpy(), output_np)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_broadcast_diff_dims():
|
||||
|
@ -357,7 +357,7 @@ def test_broadcast_diff_dims_float64():
|
|||
assert np.allclose(output_ms.asnumpy(), output_np)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_broadcast_fp16():
|
||||
|
@ -420,7 +420,7 @@ def test_broadcast_fp16():
|
|||
assert np.allclose(output_ms.asnumpy(), output_np)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_divnonan_int8():
|
||||
|
@ -440,7 +440,7 @@ def test_divnonan_int8():
|
|||
assert np.allclose(output_ms.asnumpy(), x2_np_zero)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_divnonan_uint8():
|
||||
|
|
|
@ -21,7 +21,7 @@ from mindspore.common.tensor import Tensor
|
|||
from mindspore.ops import operations as P
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_broadcast():
|
||||
|
@ -69,7 +69,7 @@ def test_broadcast():
|
|||
assert np.allclose(output.asnumpy(), expect)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_broadcast_dyn_init():
|
||||
|
|
|
@ -53,7 +53,7 @@ class NetDynamic(Cell):
|
|||
return output
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_cast():
|
||||
|
@ -224,7 +224,7 @@ def test_cast9():
|
|||
type1 = output[1].asnumpy().dtype
|
||||
assert type1 == 'float16'
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_cast10():
|
||||
|
@ -292,7 +292,7 @@ def test_cast13():
|
|||
type1 = output[1].asnumpy().dtype
|
||||
assert type1 == 'float16'
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_cast14():
|
||||
|
@ -547,7 +547,7 @@ def test_cast28():
|
|||
type1 = output[1].asnumpy().dtype
|
||||
assert type1 == 'int16'
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_cast29():
|
||||
|
@ -599,7 +599,7 @@ def test_cast31():
|
|||
assert type1 == 'uint32'
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_cast32():
|
||||
|
|
|
@ -47,13 +47,13 @@ def check_valid(nptype):
|
|||
output = boundingbox_decode(anchor_box, image_metas_box)
|
||||
assert np.array_equal(output.asnumpy(), expect)
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_check_valid_float32():
|
||||
check_valid(np.float32)
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_check_valid_float16():
|
||||
|
|
|
@ -51,13 +51,13 @@ def axis32(nptype):
|
|||
[3., 6., 7.]]]).astype(nptype)
|
||||
assert (output.asnumpy() == expect).all()
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_axis32_float64():
|
||||
axis32(np.float64)
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_axis32_float32():
|
||||
|
@ -112,13 +112,13 @@ def axis43(nptype):
|
|||
[14., 15., 21., 22., 23.]]]]).astype(nptype)
|
||||
assert (output.asnumpy() == expect).all()
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_axis43_float64():
|
||||
axis43(np.float64)
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_axis43_float32():
|
||||
|
@ -130,7 +130,7 @@ def test_axis43_float32():
|
|||
def test_axis43_int16():
|
||||
axis43(np.int16)
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_axis43_uint8():
|
||||
|
@ -167,13 +167,13 @@ def axis21(nptype):
|
|||
[2., 3., 3., 4., 5.]]).astype(nptype)
|
||||
assert (output.asnumpy() == expect).all()
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_axis21_float64():
|
||||
axis21(np.float64)
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_axis21_float32():
|
||||
|
@ -185,7 +185,7 @@ def test_axis21_float32():
|
|||
def test_axis21_int16():
|
||||
axis21(np.int16)
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_axis21_uint8():
|
||||
|
@ -225,13 +225,13 @@ def concat_3i(nptype):
|
|||
diff = output_ms.asnumpy() - output_np
|
||||
assert np.all(diff < error)
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_concat_3i_float64():
|
||||
concat_3i(np.float64)
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_concat_3i_float32():
|
||||
|
@ -298,13 +298,13 @@ def concat_4i(nptype):
|
|||
diff = output_ms.asnumpy() - output_np
|
||||
assert np.all(diff < error)
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_concat_4i_float64():
|
||||
concat_4i(np.float64)
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_concat_4i_float32():
|
||||
|
|
|
@ -47,7 +47,7 @@ class Conv2dFilter(nn.Cell):
|
|||
return self.conv_filter(out, x, self.get_shape(w))
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_conv2d_backprop_filter():
|
||||
|
|
|
@ -46,7 +46,7 @@ class Conv2dInput(nn.Cell):
|
|||
return self.conv_input(out, w, self.get_shape(x))
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_conv2d_backprop_input():
|
||||
|
|
|
@ -43,7 +43,7 @@ class NetConv2d(nn.Cell):
|
|||
return self.conv(x, w)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_conv2d():
|
||||
|
@ -86,7 +86,7 @@ class NetConv(nn.Cell):
|
|||
return self.conv(self.x)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_conv():
|
||||
|
@ -190,7 +190,7 @@ class NetConv2dDynamic(nn.Cell):
|
|||
return x_conv
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_conv2d_dynamic():
|
||||
|
@ -251,7 +251,7 @@ class NetConvNHWC(nn.Cell):
|
|||
return self.conv(self.x)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_conv_NHWC():
|
||||
|
|
|
@ -40,7 +40,7 @@ class NetConv3dTranspose(nn.Cell):
|
|||
return self.conv_trans(x, w)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_conv3d_transpose():
|
||||
|
|
|
@ -36,7 +36,7 @@ class Net(nn.Cell):
|
|||
return dx, d_batch_std
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_correction_mul_grad():
|
||||
|
|
|
@ -35,7 +35,7 @@ class Net(nn.Cell):
|
|||
return self.op(x, batch_var, moving_var)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_correction_mul():
|
||||
|
|
|
@ -41,7 +41,7 @@ def test_cos_float16():
|
|||
def test_cos_float32():
|
||||
cos(np.float32)
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_cos_float64():
|
||||
|
|
|
@ -190,7 +190,7 @@ def test_crop_and_resize_float16_nearest(datatype=np.float16):
|
|||
assert np.all(abs(diff) < error)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_crop_and_resize_float32_bilinear(datatype=np.float32):
|
||||
|
@ -239,7 +239,7 @@ def test_crop_and_resize_float32_bilinear(datatype=np.float32):
|
|||
assert np.all(abs(diff) < error)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_crop_and_resize_float64_nearest(datatype=np.float64):
|
||||
|
@ -284,7 +284,7 @@ def test_crop_and_resize_float64_nearest(datatype=np.float64):
|
|||
assert np.all(abs(diff) < error)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_crop_and_resize_int64_bilinearv2(datatype=np.int64):
|
||||
|
|
|
@ -47,7 +47,7 @@ class GradData(nn.Cell):
|
|||
return self.grad(self.network)(probs, indices, labels, input_lengths)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_ctcloss():
|
||||
|
|
|
@ -47,7 +47,7 @@ class Conv2dBpropInputInplace(nn.Cell):
|
|||
return y
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_inplace_fusion1():
|
||||
|
|
|
@ -126,7 +126,7 @@ def cum_prod(nptype):
|
|||
assert np.all(diff6 < error6)
|
||||
assert output[6].shape == expect6.shape
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_cum_prod_uint8():
|
||||
|
@ -144,13 +144,13 @@ def test_cum_prod_int8():
|
|||
def test_cum_prod_int32():
|
||||
cum_prod(np.int32)
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_cum_prod_float16():
|
||||
cum_prod(np.float16)
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_cum_prod_float32():
|
||||
|
|
|
@ -132,7 +132,7 @@ def cum_sum(nptype):
|
|||
def test_cum_sum_uint8():
|
||||
cum_sum(np.uint8)
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_cum_sum_int8():
|
||||
|
@ -144,13 +144,13 @@ def test_cum_sum_int8():
|
|||
def test_cum_sum_int32():
|
||||
cum_sum(np.int32)
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_cum_sum_float16():
|
||||
cum_sum(np.float16)
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_cum_sum_float32():
|
||||
|
|
|
@ -34,7 +34,7 @@ class BiasAdd(nn.Cell):
|
|||
return self.ba(x, b)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_biasadd():
|
||||
|
@ -98,7 +98,7 @@ class DenseNet(nn.Cell):
|
|||
return self.dense(x)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_dx():
|
||||
|
@ -128,7 +128,7 @@ def test_dx():
|
|||
assert np.all(-diff < error)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_dx_ND():
|
||||
|
@ -169,7 +169,7 @@ def test_dx_ND():
|
|||
assert np.all(-diff < error)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_dw():
|
||||
|
@ -206,7 +206,7 @@ def test_dw():
|
|||
assert np.all(-diff < db_error)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_dw_ND():
|
||||
|
@ -259,7 +259,7 @@ class Grad(nn.Cell):
|
|||
return self.grad(self.network)(input_, bias, dy)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_biasadd_3d():
|
||||
|
@ -326,7 +326,7 @@ def test_biasadd_3d():
|
|||
assert np.all(-diff < error)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_biasadd_4d():
|
||||
|
@ -455,7 +455,7 @@ class BiasAddDynamic(nn.Cell):
|
|||
output = self.ba(x, b)
|
||||
return output
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_bias_add_dynamic_two_inputs():
|
||||
|
|
|
@ -75,13 +75,13 @@ def DepthToSpace_pynative(nptype, block_size=2, input_shape=(1, 12, 1, 1)):
|
|||
assert (output.asnumpy() == expect).all()
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_depthtospace_graph_float32():
|
||||
DepthToSpace(np.float32)
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_depthtospace_graph_float16():
|
||||
|
@ -135,13 +135,13 @@ def test_depthtospace_graph_uint32():
|
|||
def test_depthtospace_graph_uint64():
|
||||
DepthToSpace(np.uint64)
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_depthtospace_pynative_float32():
|
||||
DepthToSpace_pynative(np.float32)
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_depthtospace_pynative_float16():
|
||||
|
|
|
@ -90,13 +90,13 @@ def div(nptype):
|
|||
assert np.all(diff4 < error4)
|
||||
assert output4.shape == expect4.shape
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_div_float64():
|
||||
div(np.float64)
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_div_float32():
|
||||
|
|
|
@ -30,7 +30,7 @@ class Net(nn.Cell):
|
|||
return self.drop(x_)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_dropout():
|
||||
|
@ -67,7 +67,7 @@ class DropoutDynamic(nn.Cell):
|
|||
return self.drop(x)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_dropout_dynamic():
|
||||
|
|
|
@ -116,14 +116,14 @@ def test_dtype_float16():
|
|||
dtype_with_testcase(ms.float16)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_dtype_float32():
|
||||
dtype_with_testcase(ms.float32)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_dtype_float64():
|
||||
|
@ -186,14 +186,14 @@ def test_dynamic_dtype_float16():
|
|||
dtype_dynamic_with_testcase(ms.float16)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_dynamic_dtype_float32():
|
||||
dtype_dynamic_with_testcase(ms.float32)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_dynamic_dtype_float64():
|
||||
|
|
|
@ -98,13 +98,13 @@ def dynamic_shape(np_type):
|
|||
def test_dynamic_shape_int32():
|
||||
dynamic_shape(np.int32)
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_dynamic_shape_float16():
|
||||
dynamic_shape(np.float16)
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_dynamic_shape_float32():
|
||||
|
|
|
@ -31,7 +31,7 @@ class NetEluGrad(nn.Cell):
|
|||
return self.eluGrad(dy, x)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_elu_grad_fp16():
|
||||
|
@ -46,7 +46,7 @@ def test_elu_grad_fp16():
|
|||
diff = output.asnumpy() - expect
|
||||
assert np.all(diff < error)
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_elu_grad_fp32():
|
||||
|
|
|
@ -30,7 +30,7 @@ class NetElu(nn.Cell):
|
|||
return self.elu(x)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_elu_fp16():
|
||||
|
@ -50,7 +50,7 @@ def test_elu_fp16():
|
|||
diff = output.asnumpy() - expect
|
||||
assert np.all(diff < error)
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_elu_fp32():
|
||||
|
|
|
@ -49,14 +49,14 @@ def embeddinglookup_testcase(nptype):
|
|||
np.testing.assert_almost_equal(expect, output.asnumpy())
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_embeddinglookup_float32():
|
||||
embeddinglookup_testcase(np.float32)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_embeddinglookup_float16():
|
||||
|
|
|
@ -136,7 +136,7 @@ def test_equal():
|
|||
assert output.shape == expect[i].shape
|
||||
print('test [%d/%d] passed!' % (i, len(x)))
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_notequal():
|
||||
|
@ -182,7 +182,7 @@ def test_notequal():
|
|||
assert output.shape == expect[i].shape
|
||||
print('test [%d/%d] passed!' % (i, len(x)))
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_greaterqual():
|
||||
|
@ -233,7 +233,7 @@ def test_greaterqual():
|
|||
print('test [%d/%d] passed!' % (i, len(x)))
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_equal_dynamic_shape():
|
||||
|
|
|
@ -31,7 +31,7 @@ class NetEqualCount(nn.Cell):
|
|||
return self.equalcount(x, y)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_equalcount():
|
||||
|
|
|
@ -34,7 +34,7 @@ class NetErf(nn.Cell):
|
|||
return self.erf(x)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_erf_fp32():
|
||||
|
@ -45,7 +45,7 @@ def test_erf_fp32():
|
|||
tol = 1e-6
|
||||
assert (np.abs(output.asnumpy() - expect) < tol).all()
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_erf_fp16():
|
||||
|
|
|
@ -34,7 +34,7 @@ class NetErfc(nn.Cell):
|
|||
return self.erfc(x)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_erfc_fp32():
|
||||
|
@ -45,7 +45,7 @@ def test_erfc_fp32():
|
|||
tol = 1e-6
|
||||
assert (np.abs(output.asnumpy() - expect) < tol).all()
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_erfc_fp16():
|
||||
|
|
|
@ -31,7 +31,7 @@ class NetExp(nn.Cell):
|
|||
return self.exp(x)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_exp():
|
||||
|
|
|
@ -119,7 +119,7 @@ def test_net_float16():
|
|||
assert np.all(output.asnumpy() == np.expand_dims(x, -1))
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_net_float32():
|
||||
|
@ -130,7 +130,7 @@ def test_net_float32():
|
|||
assert np.all(output.asnumpy() == np.expand_dims(x, -1))
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_net_float64():
|
||||
|
|
|
@ -31,7 +31,7 @@ class Net(nn.Cell):
|
|||
return self.extractimagepatches(input_tensor)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_extract_image_patches_valid():
|
||||
|
@ -62,7 +62,7 @@ def test_extract_image_patches_valid():
|
|||
assert np.all(output.asnumpy() == expect)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_extract_image_patches_same():
|
||||
|
|
|
@ -36,7 +36,7 @@ class Net(nn.Cell):
|
|||
return self.op(x, minq, maxq)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_fake_quant_perchannel1():
|
||||
|
@ -77,7 +77,7 @@ def test_fake_quant_perchannel2():
|
|||
assert np.all(np.abs(diff) < error)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_fake_quant_perchannel3():
|
||||
|
@ -387,7 +387,7 @@ def test_fake_quant_perchannel15():
|
|||
assert np.all(np.abs(diff) < error)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_fake_quant_perchannel16():
|
||||
|
@ -408,7 +408,7 @@ def test_fake_quant_perchannel16():
|
|||
assert np.all(np.abs(diff) < error)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_fake_quant_perchannel17():
|
||||
|
@ -571,7 +571,7 @@ def test_fake_quant_perchannel23():
|
|||
assert np.all(np.abs(diff) < error)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_fake_quant_perchannel24():
|
||||
|
@ -598,7 +598,7 @@ def test_fake_quant_perchannel24():
|
|||
assert np.all(np.abs(diff) < error)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_fake_quant_perchannel25():
|
||||
|
|
|
@ -309,7 +309,7 @@ def test_fake_quant_grad11():
|
|||
assert np.all(np.abs(diff) < error)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_fake_quant_grad12():
|
||||
|
@ -341,7 +341,7 @@ def test_fake_quant_grad12():
|
|||
assert np.all(np.abs(diff) < error)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_fake_quant_grad13():
|
||||
|
|
|
@ -42,7 +42,7 @@ class Net(nn.Cell):
|
|||
return self.fake_quant(x, minq, maxq)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_fake_quant1():
|
||||
|
@ -346,7 +346,7 @@ def test_fake_quant15():
|
|||
assert np.all(np.abs(diff) < error)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_fake_quant16():
|
||||
|
@ -366,7 +366,7 @@ def test_fake_quant16():
|
|||
assert np.all(np.abs(diff) < error)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_fake_quant17():
|
||||
|
|
|
@ -179,7 +179,7 @@ def test_fake_quant_grad7():
|
|||
assert np.all(np.abs(diff) < error)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_fake_quant_grad8():
|
||||
|
@ -200,7 +200,7 @@ def test_fake_quant_grad8():
|
|||
assert np.all(np.abs(diff) < error)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_fake_quant_grad9():
|
||||
|
|
|
@ -32,7 +32,7 @@ class NetFlattenGrad(nn.Cell):
|
|||
return self.flattengrad(x, self.type)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_flatten_grad():
|
||||
|
|
|
@ -76,7 +76,7 @@ class NetLastFlatten(nn.Cell):
|
|||
return x
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_flatten():
|
||||
|
@ -93,7 +93,7 @@ def test_flatten():
|
|||
assert (output.asnumpy() == expect).all()
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_all_flatten():
|
||||
|
@ -127,7 +127,7 @@ def test_first_flatten():
|
|||
assert (output.asnumpy() == expect).all()
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_last_flatten():
|
||||
|
|
|
@ -64,7 +64,7 @@ x2 = np.array([[np.inf, 1, 88.0, 0]]).astype(np.float32)
|
|||
x3 = np.array([[1, 2], [3, 4], [5.0, 88.0]]).astype(np.float32)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
@pytest.mark.parametrize('dtype', [np.float16, np.float32, np.float64])
|
||||
|
@ -88,7 +88,7 @@ def test_status(dtype):
|
|||
assert output3.asnumpy()[0] == expect3
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
@pytest.mark.parametrize('dtype', [np.float16, np.float32, np.float64])
|
||||
|
@ -112,7 +112,7 @@ def test_nan(dtype):
|
|||
assert (output3.asnumpy() == expect3).all()
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
@pytest.mark.parametrize('dtype', [np.float16, np.float32, np.float64])
|
||||
|
@ -136,7 +136,7 @@ def test_inf(dtype):
|
|||
assert (output3.asnumpy() == expect3).all()
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
@pytest.mark.parametrize('dtype', [np.float16, np.float32, np.float64])
|
||||
|
|
|
@ -29,7 +29,7 @@ class NetFloorDiv(nn.Cell):
|
|||
def construct(self, x, y):
|
||||
return self.floordiv(x, y)
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_floor_div():
|
||||
|
|
|
@ -41,7 +41,7 @@ class NetFtrl(nn.Cell):
|
|||
return output
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_ftrl():
|
||||
|
|
|
@ -32,7 +32,7 @@ class GatherNet(nn.Cell):
|
|||
return self.gather(x, indices, 1)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_gather0():
|
||||
|
@ -856,7 +856,7 @@ class GatherNet1(nn.Cell):
|
|||
return self.gather(x, indices, -1)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_gather1():
|
||||
|
@ -910,7 +910,7 @@ class GatherNet2(nn.Cell):
|
|||
return self.gather(x, indices, 0)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_gather2():
|
||||
|
@ -959,7 +959,7 @@ class GatherNetDynamic(nn.Cell):
|
|||
return self.gather(x, indices, self.axis)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_gatherV2_dyn_ab():
|
||||
|
@ -990,7 +990,7 @@ def test_gatherV2_dyn_ab():
|
|||
assert np.all(-diff < error)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_gatherV2_dyn_a():
|
||||
|
@ -1066,7 +1066,7 @@ def test_gatherV2_dyn_a():
|
|||
assert np.all(-diff < error)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_gatherV2_dyn_b():
|
||||
|
@ -1137,7 +1137,7 @@ def test_gatherV2_dyn_b():
|
|||
assert np.all(-diff < error)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_gather1_float64():
|
||||
|
@ -1182,7 +1182,7 @@ def test_gather1_float64():
|
|||
assert np.all(-diff < error)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_gather1_int32():
|
||||
|
|
|
@ -33,7 +33,7 @@ class GatherDNet(nn.Cell):
|
|||
def construct(self, x, index):
|
||||
return self.gather_d(x, self.dim, index)
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_gather_grad_graph_int32_fp32():
|
||||
|
@ -52,7 +52,7 @@ def test_gather_grad_graph_int32_fp32():
|
|||
diff = output[0].asnumpy() - expect
|
||||
assert np.all(diff < error)
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_gather_grad_graph_int64_fp32():
|
||||
|
@ -71,7 +71,7 @@ def test_gather_grad_graph_int64_fp32():
|
|||
diff = output[0].asnumpy() - expect
|
||||
assert np.all(diff < error)
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_gather_grad_graph_int32_fp16():
|
||||
|
@ -90,7 +90,7 @@ def test_gather_grad_graph_int32_fp16():
|
|||
diff = output[0].asnumpy() - expect
|
||||
assert np.all(diff < error)
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_gather_grad_graph_int64_fp16():
|
||||
|
@ -109,7 +109,7 @@ def test_gather_grad_graph_int64_fp16():
|
|||
diff = output[0].asnumpy() - expect
|
||||
assert np.all(diff < error)
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_gather_grad_pynative_int32_fp32():
|
||||
|
@ -126,7 +126,7 @@ def test_gather_grad_pynative_int32_fp32():
|
|||
diff = output.asnumpy() - expect
|
||||
assert np.all(diff < error)
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_gather_grad_pynative_int64_fp32():
|
||||
|
@ -143,7 +143,7 @@ def test_gather_grad_pynative_int64_fp32():
|
|||
diff = output.asnumpy() - expect
|
||||
assert np.all(diff < error)
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_gather_grad_pynative_int32_fp16():
|
||||
|
@ -160,7 +160,7 @@ def test_gather_grad_pynative_int32_fp16():
|
|||
diff = output.asnumpy() - expect
|
||||
assert np.all(diff < error)
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_gather_grad_pynative_int64_fp16():
|
||||
|
|
|
@ -32,7 +32,7 @@ class GatherNet(nn.Cell):
|
|||
def construct(self, x, index):
|
||||
return self.gather(x, self.dim, index)
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_gather_pynative_fp32_int32():
|
||||
|
@ -46,7 +46,7 @@ def test_gather_pynative_fp32_int32():
|
|||
diff = output.asnumpy() - expect
|
||||
assert np.all(diff < error)
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_gather_pynative_fp32_int64():
|
||||
|
@ -60,7 +60,7 @@ def test_gather_pynative_fp32_int64():
|
|||
diff = output.asnumpy() - expect
|
||||
assert np.all(diff < error)
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_gather_pynative_fp16_int32():
|
||||
|
@ -74,7 +74,7 @@ def test_gather_pynative_fp16_int32():
|
|||
diff = output.asnumpy() - expect
|
||||
assert np.all(diff < error)
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_gather_pynative_fp16_int64():
|
||||
|
|
|
@ -40,7 +40,7 @@ def gathernd0(nptype):
|
|||
|
||||
assert np.array_equal(output.asnumpy(), expect)
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_gathernd0_float64():
|
||||
|
@ -116,13 +116,13 @@ def gathernd1(nptype):
|
|||
|
||||
assert np.array_equal(output.asnumpy(), expect)
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_gathernd1_float64():
|
||||
gathernd1(np.float64)
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_gathernd1_float32():
|
||||
|
@ -175,13 +175,13 @@ def gathernd2(nptype):
|
|||
|
||||
assert np.array_equal(output.asnumpy(), expect)
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_gathernd2_float64():
|
||||
gathernd2(np.float64)
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_gathernd2_float32():
|
||||
|
@ -225,7 +225,7 @@ def test_gathernd_bool():
|
|||
|
||||
assert np.array_equal(output.asnumpy(), expect)
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_gathernd_indices_int64():
|
||||
|
|
|
@ -45,7 +45,7 @@ class Grad(nn.Cell):
|
|||
return gout
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_gelugrad():
|
||||
|
@ -62,7 +62,7 @@ def test_gelugrad():
|
|||
0.34266686, 0.57757664, 0.04707306, 0.51536125]
|
||||
assert np.allclose(output[0].asnumpy(), expect)
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_gelugrad_fp16():
|
||||
|
|
|
@ -37,7 +37,7 @@ def GeluCompute(x):
|
|||
return 0.5 * x * (1.0 + np.tanh(np.sqrt(2 / np.pi) * (x + 0.044715 * x * x * x)))
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_gelu_1d():
|
||||
|
@ -51,7 +51,7 @@ def test_gelu_1d():
|
|||
assert np.allclose(y_np, y_ms.asnumpy())
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_gelu_2d():
|
||||
|
@ -65,7 +65,7 @@ def test_gelu_2d():
|
|||
assert np.allclose(y_np, y_ms.asnumpy())
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_gelu_4d():
|
||||
|
@ -79,7 +79,7 @@ def test_gelu_4d():
|
|||
assert np.allclose(y_np, y_ms.asnumpy())
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_gelu_neg():
|
||||
|
@ -92,7 +92,7 @@ def test_gelu_neg():
|
|||
|
||||
assert np.allclose(y_np, y_ms.asnumpy())
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_gelu_4d_fp16():
|
||||
|
|
|
@ -22,7 +22,7 @@ import mindspore.nn as nn
|
|||
import mindspore.context as context
|
||||
|
||||
# test to make sure this op actually generates a dynamically shaped output
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_gpu_convert_to_dyanamic_shape_confirm_dynamic():
|
||||
|
@ -103,13 +103,13 @@ def test_gpu_convert_to_dynamic_shape_bool():
|
|||
def test_gpu_convert_to_dynamic_shape_float16():
|
||||
gpu_convert_to_dynamic_shape_float(np.float16)
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_gpu_convert_to_dynamic_shape_float32():
|
||||
gpu_convert_to_dynamic_shape_float(np.float32)
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_gpu_convert_to_dynamic_shape_float64():
|
||||
|
|
|
@ -90,21 +90,21 @@ def generate_dynamic_testcase(nptype):
|
|||
np.testing.assert_almost_equal(output.asnumpy(), expect)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_hsigmoid_dynamic_float32():
|
||||
generate_dynamic_testcase(np.float32)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_hsigmoid_float32():
|
||||
generate_testcases(np.float32)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_hsigmoid_float16():
|
||||
|
|
|
@ -71,7 +71,7 @@ def generate_test_cases(np_type, mode):
|
|||
judge_result_correct(output[0].asnumpy(), expect)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_hswish_forward_and_backward():
|
||||
|
|
|
@ -48,14 +48,14 @@ def generate_testcases(nptype):
|
|||
assert id(input_tensor) != id(output)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_identity_float64():
|
||||
generate_testcases(np.float64)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_identity_float32():
|
||||
|
|
|
@ -100,19 +100,19 @@ def in_top_k(nptype):
|
|||
expected_output = np.array([True, True, True])
|
||||
np.testing.assert_array_equal(output.asnumpy(), expected_output)
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_in_top_k_float16():
|
||||
in_top_k(np.float16)
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_in_top_k_float32():
|
||||
in_top_k(np.float32)
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.level1
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_in_top_k_invalid_input():
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue