> One thing to be careful about is that when using shift and normalize, right > shift corresponds to round down as opposed to round to nearest, an additional > 0.5 equivalence needs to be added to get the round behavior
Yes, I think it is little more complicated. The std::round of -2.5 is -3. Therefore, for negative numbers the rounder is not 0.5, its actually decimal equivalent of 0.0111111b (the number is represented in 2's complement). This brings in lot more new instructions. I will add some examples. > if followed by relu, you can skip extra round processing for negative values. Aaah, very nice observation. > if using convergent nearest/even rounding, also need to handle the boundary > cases for even/odd decision. Lets skip this for the first implementation. Once we have normal rounding working, we can add a rounding parameter to the op which can lead to a different sequence of instructions. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/dmlc/tvm/issues/2351#issuecomment-509016182