Thanks for your answer! Your solution worked. I don’t think it will go to inf in this case. As long as the input x isn’t a scalar or something like [1,1…1,1], var(x) will be nonzero. Also as stated in the document, there is the epsilon there which will prevent the inf case from happening. I tried using a scalar, and it didn’t explode.