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(difference)
  return t.mean(squared_deviations, dim=dim, keepdim=keepdim)