lfengad edited a comment on issue #4990: [TF][Relay] BatchNorm support with run-time mean and variance calculation URL: https://github.com/apache/incubator-tvm/pull/4990#issuecomment-595562012 > > Yeah, our current implementation is just to check whether `mean` / `variance` is empty `VarNode` (with zero dimension), and then call `Mean` and `Variance` in BatchNormToInferUnpack. > >> I think our pr could remove `name_hint` too. Yeah, I agree that the better way should be removing `name_hint` and just checking whether the `mean` and `variance` are empty inside `BatchNormToInferUnpack`, with no need to modify the tensorflow frontend. Previously I have tried this way but got come compilation errors related with data shape checking. If we plan to do in this way, we need to modify the `BatchNormRel` for data shape assignment too, since the current `batch_norm` relay operator only accept `mean` and `variance` with non-empty dimension. We need to make it accept `mean` and `variance` with empty dimension. > > > if mean / variance is VarNode but with non-zero dimension, it still has the possibility to hold the given pre-defined constant values and thus cannot be replaced with Mean \ Variance. > > >Could you give us an example of this condition? I could only imagine models have empty or full pre-defined values. So we should only to calculate it by calling `Mean` / `Variance` feed by `data` or our current implementation of `BatchNormToInferUnpack `. What I mean is that for both cases the `mean` and `variance` are `VarNode`. In one case the `VarNode` is empty without pre-defined values, while in the other case the `VarNode` is not empty with pre-defined values. Thank you for the discussion!
---------------------------------------------------------------- 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
