anchor.diff:      member t.Sum(dim) = Tensor.Sum(t, dim)
   
       static member Sum(a:Tensor, dim:int, keepDim:bool) = if keepDim then Tensor.Sum(a, dim).Unsqueeze(dim) else Tensor.Sum(a, dim)
  +
       member t.Sum(dim, keepDim) = Tensor.Sum(t, dim, keepDim)
   
       static member Mean (a:Tensor) = Tensor.Sum(a) / a.Nelement
  +
       member t.Mean() = Tensor.Mean(t)
   
       static member Mean(a:Tensor, dim:int) = 
           if dim = 0 && a.Dim = 0 then a
           else a.Sum(dim) / a.Shape.[dim]
  +
       member t.Mean(dim) = Tensor.Mean(t, dim)
   
       // This is the two-pass algorithm better than the naive algorithm
       static member Variance (a:Tensor) = let a' = a - Tensor.Mean(a) in Tensor.Sum(a' * a') / (a.Nelement - 1)
  +
       member t.Variance() = Tensor.Variance(t)
   
       // TODO: this is the naive algorithm, can be improved for better numerical stability
  
positive.code:         let i4max = i4
          let bounds = array2D [[i0min; i0max]; [i1min; i1max]; [i2min; i2max]; [i3min; i3max]; [i4min; i4max]]
          t.GetSlice(bounds)
      member t.GetSlice(i0:int, i1min:int option, i1max:int option, i2min:int option, i2max:int option, i3min:int option, i3max:int option, i4min:int option, i4max:int option) =
          let i0min = i0
          let i0max = i0
  
negative.code:         let i5max = defaultArg i5max (t.Shape.[5] - 1)
          let bounds = array2D [[i0min; i0max]; [i1min; i1max]; [i2min; i2max]; [i3min; i3max]; [i4min; i4max]; [i5min; i5max]]
          t.GetSlice(bounds)
  
      member t.GetSlice(i0:int, i1:int, i2:int, i3min:int option, i3max:int option, i4min:int option, i4max:int option, i5:int) =
          let i0min = i0
          let i0max = i0
  