zhreshold commented on a change in pull request #12412: Infer dtype in 
SymbolBlock import from input symbol
URL: https://github.com/apache/incubator-mxnet/pull/12412#discussion_r216438998
 
 

 ##########
 File path: python/mxnet/gluon/block.py
 ##########
 @@ -1053,13 +1054,20 @@ def __init__(self, outputs, inputs, params=None):
                     "SymbolBlock doesn't support Parameter '%s' because its 
storage " \
                     "type is 'row_sparse'." % j.name
 
-        for i in out.list_arguments():
-            if i not in input_names:
-                self.params.get(i, allow_deferred_init=True)
+        # Infer type of parameters. Without this, every parameter will be 
created with
+        # default type i.e., fp32
+        arg_params = out.list_arguments()
+        aux_params = out.list_auxiliary_states()
 
-        for i in out.list_auxiliary_states():
-            if i not in input_names:
-                self.params.get(i, grad_req='null', allow_deferred_init=True)
+        arg_types, aux_types = _infer_param_types(inputs[0], out, arg_params, 
aux_params)
 
 Review comment:
   this does not handle Grouped Symbol because you are only slicing [0] from 
the symbol.

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


With regards,
Apache Git Services

Reply via email to