Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Reduce time cost of test_operator.test_norm, test_operator. test_laop_5 and test_sparse_operator.test_elemwise_binary_ops #16067

Merged
merged 1 commit into from
Sep 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tests/python/unittest/test_operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -6808,7 +6808,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)
Expand Down
4 changes: 2 additions & 2 deletions tests/python/unittest/test_sparse_operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]:
Expand Down