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/09/18 21:07:32 UTC

[GitHub] [incubator-mxnet] junrushao1994 edited a comment on issue #16188: symbol.contrib.cond does not support some built-in operators

junrushao1994 edited a comment on issue #16188: symbol.contrib.cond does not support some built-in operators
URL: https://github.com/apache/incubator-mxnet/issues/16188#issuecomment-532863882
 
 
   A minimal example would be:
   
   ```python
   import mxnet as mx
   from mxnet import nd, autograd, gluon
   
   class MLP(gluon.HybridBlock):
       def __init__(self, **kwargs):
           super(MLP, self).__init__(**kwargs)
           with self.name_scope():
               self.dense1 = gluon.nn.Dense(1, in_units=1)
   
       def hybrid_forward(self, F, x):
           cond_out = F.contrib.cond(F.ones(1) == F.ones(1), lambda: self.dense1(x), lambda: F.round(x))
           return cond_out
   ```
   

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