From 7cc22ea74ad7577113320b2859c82f45ebbb4f62 Mon Sep 17 00:00:00 2001 From: "Shi, guangyong" <35016185+gyshi@users.noreply.github.com> Date: Tue, 3 Sep 2019 13:04:36 +0800 Subject: [PATCH] fix some test files test time is too long (#16067) --- tests/python/unittest/test_operator.py | 4 ++-- tests/python/unittest/test_sparse_operator.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/python/unittest/test_operator.py b/tests/python/unittest/test_operator.py index de02727e24c8..e4617afd112a 100644 --- a/tests/python/unittest/test_operator.py +++ b/tests/python/unittest/test_operator.py @@ -3704,7 +3704,7 @@ def l2norm(input_data, axis=0, keepdims=True): ctx = default_context() data = mx.symbol.Variable('data') - in_data_dim = random_sample([4,5,6], 1)[0] + in_data_dim = random_sample([2,3,4], 1)[0] in_shape = rand_shape_nd(in_data_dim, dim=5) epsilon = 1e-3 acc_type = {np.float16: np.float32, np.float32: np.float32, np.float64: np.float64, @@ -6807,7 +6807,7 @@ def test_laop_5(): # tests for diagonal and triangular matrix extraction and generation data = mx.symbol.Variable('data') # test complete range of small matrices to cover corner cases - for n in range(1, 10): + for n in range(1, 5): # test batched and non-batched processing for b in range(3): shape = (n, n) if b == 0 else (b, n, n) diff --git a/tests/python/unittest/test_sparse_operator.py b/tests/python/unittest/test_sparse_operator.py index 05175bb435f2..91194c562a57 100644 --- a/tests/python/unittest/test_sparse_operator.py +++ b/tests/python/unittest/test_sparse_operator.py @@ -494,10 +494,10 @@ def check_elemwise_binary_ops(lhs_stype, rhs_stype, shape, for ii in range(1): # Run defaults - check_elemwise_binary_ops('default', 'default', rand_shape_2d()) + check_elemwise_binary_ops('default', 'default', rand_shape_2d(5, 5)) # Try different densities - shape = rand_shape_2d() + shape = rand_shape_2d(5, 5) for lhs_density in [0.0, random.uniform(0, 1), 1.0]: for rhs_density in [0.0, random.uniform(0, 1), 1.0]: for ograd_density in [0.0, random.uniform(0, 1), 1.0]: