apache / mxnet

Lightweight, Portable, Flexible Distributed/Mobile Deep Learning with Dynamic, Mutation-aware Dataflow Dep Scheduler; for Python, R, Julia, Scala, Go, Javascript and more
https://mxnet.apache.org
Apache License 2.0
20.77k stars 6.79k forks source link

[Feature Request] Assertion operators #12484

Open jasonyu1996 opened 6 years ago

jasonyu1996 commented 6 years ago

Hi! I personally would be happy to see assertion operators in MXNet. While they might seem useless for imperative computations (the NDArray API), I believe they are absolutely helpful for symbolic computation (the Symbol API), especially when implementing libraries (e.g., implementing a library function that takes as input some symbols and returns the result after performing several symbols), where the validity of the input should be checked. Tensorflow has these https://tensorflow.google.cn/api_guides/python/check_ops . It should be noted that in order to ensure that these assertions are executed, how to add them to the computational graph in order to make the output dependent on these assertions should be considered.

vrakesh commented 6 years ago

@jasonyu1996 thank you for the feature request .

@mxnet-label-bot [Feature request]

eric-haibin-lin commented 6 years ago

+1 @haojin2 @apeforest @samskalicky

jasonyu1996 commented 6 years ago

It seems that I am not the only person who thinks this type of operators beneficial. Is anyone interested in implementing this? @haojin2 @apeforest @samskalicky

jasonyu1996 commented 6 years ago

@eric-haibin-lin Hi! Do you think it is necessary to provide an interface for explicitly defining dependencies like this https://www.tensorflow.org/api_docs/python/tf/control_dependencies ?

yemenr commented 5 years ago

@jasonyu1996 Same question...

jasonyu1996 commented 5 years ago

It seems that this is indeed a feature in need. Could you please provide some instructions on how this should be implemented? @haojin2 @apeforest @samskalicky