zheng-da commented on a change in pull request #11760: [MXNET-684] Add `ifelse`
operator
URL: https://github.com/apache/incubator-mxnet/pull/11760#discussion_r203913694
##########
File path: python/mxnet/ndarray/contrib.py
##########
@@ -363,3 +362,97 @@ def _func_wrapper(loop_vars):
[" Step %d, shape is %s" % (i, str(x.shape)) for i, x in
enumerate(items)]
))
return stacked_outputs, list(loop_vars)
+
+def ifelse(cond, then_func, else_func, inputs):
+ """Run a if-then-else using user-defined condition and computation
+
+ This operator simulates a if-like branch which chooses to do one of
+ the two customized computations according to the specified condition.
+
+ `inputs` is a list of NDArrays on which the condition and computations
reply on.
Review comment:
reply => rely
----------------------------------------------------------------
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