You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2019/10/31 15:22:18 UTC

[GitHub] [incubator-mxnet] sxjscience commented on a change in pull request #16680: Implement Initializer.__eq__

sxjscience commented on a change in pull request #16680: Implement Initializer.__eq__
URL: https://github.com/apache/incubator-mxnet/pull/16680#discussion_r341202016
 
 

 ##########
 File path: tests/python/unittest/test_gluon.py
 ##########
 @@ -3119,6 +3119,18 @@ def forward(self, x):
         shape = (np.random.randint(1, 10), np.random.randint(1, 10), 1)
         block(mx.nd.ones(shape))
 
+def test_shared_parameters_with_non_default_initializer():
+    class MyBlock(gluon.HybridBlock):
+        def __init__(self, **kwargs):
+            super().__init__(**kwargs)
+
+            with self.name_scope():
+                self.param = self.params.get("param", shape=(1, ), init=mx.init.Constant(-10.0))
+
+    bl = MyBlock()
+    MyBlock(params=bl.collect_params())
 
 Review comment:
   Should we check whether the internal parameters are the same?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services