ConvolutedDog commented on issue #19574:
URL: https://github.com/apache/tvm/issues/19574#issuecomment-4582114995

   It seems that this behavior is consistent with the current Relax semantics. 
`relax.nn.batch_norm` defaults to `training=True`:
   
   
https://github.com/apache/tvm/blob/b971a75de46ea12692e36946f7285537057f0cc6/python/tvm/relax/op/nn/nn.py#L1619-L1741
   
   When `training=True`, normalization uses statistics computed from the 
current batch, not the provided `moving_mean` and `moving_var`. Normalization 
will only use the provided `moving_mean` and `moving_var` when you set 
`training=False` or manually apply the `DecomposeOpsForInference` pass.
   
   In your program, out_legalize is calculated based on training, while 
out_correct is calculated based on inference, so they are naturally different.


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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to