Hi Smile!



 yg-smile:

Do we need two - large * (1 - msk)'s or one is good enough?


The second - large * (1 - msk) is protection against an edge case.
If one of the masked values in your tensor were equal to (or close
enough to) large, then a single - large * (1 - msk) would reduce
it only to zero, so if all of the unmasked values in your tensor were
negative, you would incorrectly get 0.0 as the maximum value.
Best.
K. Frank