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

Commit

Permalink
comment test when platform is windows
Browse files Browse the repository at this point in the history
  • Loading branch information
JiangZhaoh committed Apr 16, 2020
1 parent 0b5e43a commit 585815b
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 31 deletions.
25 changes: 14 additions & 11 deletions tests/python/unittest/test_numpy_default_dtype.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()



Expand Down
40 changes: 20 additions & 20 deletions tests/python/unittest/test_numpy_gluon.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__':
Expand Down

0 comments on commit 585815b

Please sign in to comment.