yifeim opened a new issue #13247: Support None as input in forward and 
hybrid_forward?
URL: https://github.com/apache/incubator-mxnet/issues/13247
 
 
   ## Description
   (Hybrid) forward supports None as defaults, but not as inputs. I was 
wondering if there are any fundamental reasons why None cannot be taken as 
input - if the pattern is consistent and I do not change the computation graph?
   
   ## Environment info (Required)
   
   ```
   ----------Python Info----------
   Version      : 3.6.5
   Compiler     : GCC 7.2.0
   Build        : ('default', 'Apr 29 2018 16:14:56')
   Arch         : ('64bit', '')
   ------------Pip Info-----------
   Version      : 10.0.1
   Directory    : 
/home/ec2-user/anaconda3/envs/mxnet_p36/lib/python3.6/site-packages/pip
   ----------MXNet Info-----------
   Version      : 1.3.0
   Directory    : 
/home/ec2-user/anaconda3/envs/mxnet_p36/lib/python3.6/site-packages/mxnet
   Commit Hash   : b3be92f4a48bce62a5a8424271871c2f81c8f7f1
   ----------System Info----------
   Platform     : Linux-4.14.77-69.57.amzn1.x86_64-x86_64-with-glibc2.9
   system       : Linux
   node         : ip-172-16-72-155
   release      : 4.14.77-69.57.amzn1.x86_64
   version      : #1 SMP Tue Nov 6 21:32:55 UTC 2018
   ----------Hardware Info----------
   machine      : x86_64
   processor    : x86_64
   ----------Network Test----------
   Setting timeout: 10
   Timing for MXNet: https://github.com/apache/incubator-mxnet, DNS: 0.0016 
sec, LOAD: 0.4079 sec.
   Timing for Gluon Tutorial(en): http://gluon.mxnet.io, DNS: 0.1175 sec, LOAD: 
0.1057 sec.
   Timing for Gluon Tutorial(cn): https://zh.gluon.ai, DNS: 0.2767 sec, LOAD: 
0.1359 sec.
   Timing for FashionMNIST: 
https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/gluon/dataset/fashion-mnist/train-labels-idx1-ubyte.gz,
 DNS: 0.0274 sec, LOAD: 0.1023 sec.
   Timing for PYPI: https://pypi.python.org/pypi/pip, DNS: 0.0023 sec, LOAD: 
0.3404 sec.
   Timing for Conda: https://repo.continuum.io/pkgs/free/, DNS: 0.0081 sec, 
LOAD: 0.3184 sec.
   ```
   
   Package used (Python/R/Scala/Julia):
   Python
   
   ## Error Message:
   ```
   AssertionError: HybridBlock input must be (nested) list of Symbol or 
NDArray, but got None of type <class 'NoneType'>
   ```
   
   ## Minimum reproducible example
   ```
   import mxnet as mx
   rnn = mx.gluon.rnn.GRU(10)
   rnn.hybridize()
   rnn.collect_params().initialize()
   rnn(mx.nd.zeros((3,2,10)), ) # this is okay
   rnn(mx.nd.zeros((3,2,10)), None) # this is not okay
   ```
   
   ## Steps to reproduce
   
   1. The example is self-contained.
   
   ## What have you tried to solve it?
   
   1. Manually construct an *args list, which seems error-prone.
   

----------------------------------------------------------------
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