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

Commit

Permalink
Update test_gluon.py
Browse files Browse the repository at this point in the history
  • Loading branch information
sxjscience committed Sep 26, 2019
1 parent c577029 commit 04765a3
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions tests/python/unittest/test_gluon.py
Original file line number Diff line number Diff line change
Expand Up @@ -473,13 +473,14 @@ def hybrid_forward(self, F, a, b):
foo1 = FooNested(prefix='foo_nested_hybridized')
foo1.hybridize()
foo2 = FooNested(prefix='foo_nested_nohybrid')
out1 = foo1(*arg_inputs)
out2 = foo2(*arg_inputs)
if isinstance(out1, tuple):
for lhs, rhs in zip(out1, out2):
assert_almost_equal(lhs.asnumpy(), rhs.asnumpy())
else:
assert_almost_equal(out1.asnumpy(), out2.asnumpy())
for _ in range(2):
out1 = foo1(*arg_inputs)
out2 = foo2(*arg_inputs)
if isinstance(out1, tuple):
for lhs, rhs in zip(out1, out2):
assert_almost_equal(lhs.asnumpy(), rhs.asnumpy())
else:
assert_almost_equal(out1.asnumpy(), out2.asnumpy())
for do_hybridize in [True, False]:
foo = FooNested()
if do_hybridize:
Expand Down

0 comments on commit 04765a3

Please sign in to comment.