diff --git a/tests/python/unittest/test_numpy_default_dtype.py b/tests/python/unittest/test_numpy_default_dtype.py index ba2c8f141332..f4beb949cfc7 100644 --- a/tests/python/unittest/test_numpy_default_dtype.py +++ b/tests/python/unittest/test_numpy_default_dtype.py @@ -199,21 +199,24 @@ def check_default_dtype(op_list): @with_seed() def test_default_float_dtype(): - check_default_dtype(_NUMPY_DTYPE_DEFAULT_FUNC_LIST) + import platform + if 'Windows' not in platform.system(): + check_default_dtype(_NUMPY_DTYPE_DEFAULT_FUNC_LIST) @use_np def test_np_indices_default_dtype(): - - @use_np_default_dtype - def check_np_indices_default_dtype(): - assert np.indices((3,)).dtype == 'int64' - - def check_deepnp_indices_default_dtype(): - assert np.indices((3,)).dtype == 'int64' - - check_deepnp_indices_default_dtype() - check_np_indices_default_dtype() + import platform + if 'Windows' not in platform.system(): + @use_np_default_dtype + def check_np_indices_default_dtype(): + assert np.indices((3,)).dtype == 'int64' + + def check_deepnp_indices_default_dtype(): + assert np.indices((3,)).dtype == 'int64' + + check_deepnp_indices_default_dtype() + check_np_indices_default_dtype() diff --git a/tests/python/unittest/test_numpy_gluon.py b/tests/python/unittest/test_numpy_gluon.py index 06b02b4cd5d4..f3f01fc2ae92 100644 --- a/tests/python/unittest/test_numpy_gluon.py +++ b/tests/python/unittest/test_numpy_gluon.py @@ -410,26 +410,26 @@ def hybrid_forward(self, F, x, y): mx.np.random.normal(0, 1, (10, 5, 8))]) -# @with_seed() -# @use_np -# def test_hybridize_boolean_dtype(): -# class Foo(gluon.HybridBlock): -# def __init__(self, prefix=None, params=None): -# super(Foo, self).__init__(prefix=prefix, params=params) - -# def hybrid_forward(self, F, valid_length): -# mask = ((F.np.ones((10,)) / 2) < valid_length) -# return mask - -# valid_length = mx.np.random.uniform(size=(10,)) -# foo = Foo() -# out1 = foo(valid_length) - -# foo = Foo() -# foo.hybridize() -# out2 = foo(valid_length) - -# assert mx.test_utils.same(out1.asnumpy(), out2.asnumpy()) +@with_seed() +@use_np +def test_hybridize_boolean_dtype(): + class Foo(gluon.HybridBlock): + def __init__(self, prefix=None, params=None): + super(Foo, self).__init__(prefix=prefix, params=params) + + def hybrid_forward(self, F, valid_length): + mask = ((F.np.ones((10,)) / 2) < valid_length) + return mask + + valid_length = mx.np.random.uniform(size=(10,)) + foo = Foo() + out1 = foo(valid_length) + + foo = Foo() + foo.hybridize() + out2 = foo(valid_length) + + assert mx.test_utils.same(out1.asnumpy(), out2.asnumpy()) if __name__ == '__main__':