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

Commit

Permalink
Test default behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
leezu committed Oct 25, 2019
1 parent 74dd12f commit 803f765
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/python/unittest/test_gluon.py
Original file line number Diff line number Diff line change
Expand Up @@ -1540,6 +1540,17 @@ def __init__(self, b1, b2):
c = C(b1, b2)
c.load_parameters('tmp.params')

# Test default behavior
c.save_parameters('tmp2.params', deduplicate=False)

params = mx.nd.load('tmp2.params')
assert len(params) == 2 # Only a single copy of the shared parameter is saved

b1 = B()
b2 = B(b1.collect_params())
c = C(b1, b2)
c.load_parameters('tmp2.params')

@with_seed()
def test_symbol_block_save_load():
class Net(gluon.HybridBlock):
Expand Down

0 comments on commit 803f765

Please sign in to comment.