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:
[email protected]


With regards,
Apache Git Services

Reply via email to