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/08/05 16:23:48 UTC

[GitHub] [incubator-mxnet] ptrendx commented on a change in pull request #15657: Eliminate common expressions

ptrendx commented on a change in pull request #15657: Eliminate common expressions
URL: https://github.com/apache/incubator-mxnet/pull/15657#discussion_r310686576
 
 

 ##########
 File path: include/mxnet/op_attr_types.h
 ##########
 @@ -208,6 +208,17 @@ using FCreateOpState = std::function<OpStatePtr (const NodeAttrs& attrs,
                                                  Context ctx,
                                                  const mxnet::ShapeVector& in_shape,
                                                  const std::vector<int>& in_type)>;
+
+/*!
+ * \brief Whether the operator always produces the same
+ *        output given the same input.
+ *        This enables certain optimizations
+ *        like common expression elimination.
+ *
+ * \note Register under "FHasDeterministicOutput"
+ */
+using FHasDeterministicOutput = bool;
 
 Review comment:
   This is an option for potential optimization - if the op uses state or requests resources then it is not considered for this optimization. This option enables marking such op as safe for deduplicating (an example of this would be Convolution, which asks for resources, but it is only a workspace). I will add this option to such relevant operators.

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