Solved by rahulbhalley in post #6 
              
              
                I found the solution myself. 
Following is an unbiased estimator implementation of variance using summation function, if anyone needs that: 
def var(input, dim, keepdim=False):
  input_means = t.mean(input, dim=dim, keepdim=True)
  difference = input - input_means
  squared_deviations = t.square(dif…