ZhennanQin commented on issue #15993: Add a contrib operator for Constant
URL: https://github.com/apache/incubator-mxnet/pull/15993#issuecomment-525535150
 
 
   I mean, If we did some constant folding optimization in the graph, and 
generate a new tensor which is not filled with same values. For example,
   ```
   scaled_weight = weight * scale, 
   out = convolution(weight = scaled_weight)
   ```
   For this code, that scale multiply will execute many times during each 
iteration of inference. Because weight and scale are all constant, so we can 
fold them before inference, and use a constant node to replace the folded 
result in the graph. The value holding by constant node is vary, which can't be 
generated with simple pattern. 

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