anchor.diff:              a.view(a.shape |> shapeFlatten startDim endDim)
   
       member a.sign() =
  -        let inline fRaw(a:RawTensor) = a.SignT()
  -        let inline fTensor(a:Tensor) = a.sign()
  -        let inline dfTensorFwd(cp:Tensor,ap,ad) = cp.zerosLike()
  -        let inline dfTensorRev(a) = SignT(a)
  +        let fRaw(a:RawTensor) = a.SignT()
  +        let fTensor(a:Tensor) = a.sign()
  +        let dfTensorFwd(cp:Tensor,ap,ad) = cp.zerosLike()
  +        let dfTensorRev(a) = SignT(a)
           Tensor.OpUnary(a, fRaw, fTensor, dfTensorFwd, dfTensorRev)
       // static member Sign(a:Tensor) = a.sign() // not supported becaose FSharp.Core sign operator returns int
   
       member a.floor() =
  -        let inline fRaw(a:RawTensor) = a.FloorT()
  -        let inline fTensor(a:Tensor) = a.floor()
  -        let inline dfTensorFwd(cp:Tensor,ap,ad) = cp.zerosLike()
  -        let inline dfTensorRev(a) = FloorT(a)
  +        let fRaw(a:RawTensor) = a.FloorT()
  +        let fTensor(a:Tensor) = a.floor()
  +        let dfTensorFwd(cp:Tensor,ap,ad) = cp.zerosLike()
  +        let dfTensorRev(a) = FloorT(a)
           Tensor.OpUnary(a, fRaw, fTensor, dfTensorFwd, dfTensorRev)
       static member Floor(a:Tensor) = a.floor() // needed for FSharp.Core floor operator overload
   
       member a.ceil() =
  -        let inline fRaw(a:RawTensor) = a.CeilT()
  -        let inline fTensor(a:Tensor) = a.ceil()
  -        let inline dfTensorFwd(cp:Tensor,ap,ad) = cp.zerosLike()
  -        let inline dfTensorRev(a) = CeilT(a)
  +        let fRaw(a:RawTensor) = a.CeilT()
  +        let fTensor(a:Tensor) = a.ceil()
  +        let dfTensorFwd(cp:Tensor,ap,ad) = cp.zerosLike()
  +        let dfTensorRev(a) = CeilT(a)
           Tensor.OpUnary(a, fRaw, fTensor, dfTensorFwd, dfTensorRev)
       static member Ceiling(a:Tensor) = a.ceil() // needed for FSharp.Core ceil operator overload
   
       member a.round() =
  -        let inline fRaw(a:RawTensor) = a.RoundT()
  -        let inline fTensor(a:Tensor) = a.round()
  -        let inline dfTensorFwd(cp:Tensor,ap,ad) = cp.zerosLike()
  -        let inline dfTensorRev(a) = RoundT(a)
  +        let fRaw(a:RawTensor) = a.RoundT()
  +        let fTensor(a:Tensor) = a.round()
  +        let dfTensorFwd(cp:Tensor,ap,ad) = cp.zerosLike()
  +        let dfTensorRev(a) = RoundT(a)
           Tensor.OpUnary(a, fRaw, fTensor, dfTensorFwd, dfTensorRev)
       static member Round(a:Tensor) = a.round() // needed for FSharp.Core round operator overload
   
       member a.abs() =
  -        let inline fRaw(a:RawTensor) = a.AbsT()
  -        let inline fTensor(a:Tensor) = a.abs()
  -        let inline dfTensorFwd(cp,ap:Tensor,ad) = ad * ap.sign()
  -        let inline dfTensorRev(a) = AbsT(a)
  +        let fRaw(a:RawTensor) = a.AbsT()
  +        let fTensor(a:Tensor) = a.abs()
  +        let dfTensorFwd(cp,ap:Tensor,ad) = ad * ap.sign()
  +        let dfTensorRev(a) = AbsT(a)
           Tensor.OpUnary(a, fRaw, fTensor, dfTensorFwd, dfTensorRev)
       static member Abs(a:Tensor) = a.abs() // needed for FSharp.Core abs operator overload
   
       member a.relu() =
  -        let inline fRaw(a:RawTensor) = a.ReluT()
  -        let inline fTensor(a:Tensor) = a.relu()
  -        let inline dfTensorFwd(cp,ap:Tensor,ad:Tensor) = let sap = ap.sign() in ad * sap.abs() * (sap + 1.) / 2.
  -        let inline dfTensorRev(a) = ReluT(a)
  +        let fRaw(a:RawTensor) = a.ReluT()
  +        let fTensor(a:Tensor) = a.relu()
  +        let dfTensorFwd(cp,ap:Tensor,ad:Tensor) = let sap = ap.sign() in ad * sap.abs() * (sap + 1.) / 2.
  +        let dfTensorRev(a) = ReluT(a)
           Tensor.OpUnary(a, fRaw, fTensor, dfTensorFwd, dfTensorRev)
   
       member a.leakyRelu(?negativeSlope:float) =
  
positive.code:             let bCast = b.cast(tnew)
              aCast / bCast
          elif a.shape = b.shape then
              let inline fRaw(a:RawTensor,b) = a.DivTT(b)
              let inline fTensor(a,b) = a / b
              let inline dfTensorFwdTT(cp:Tensor,ap:Tensor,ad:Tensor,bp:Tensor,bd:Tensor) = (ad - bd * cp) / bp
              let inline dfTensorFwdTC(cp:Tensor,ap:Tensor,ad:Tensor) = ad / b
              let inline dfTensorFwdCT(cp:Tensor,bp:Tensor,bd:Tensor) = -bd * cp / bp
              let inline dfTensorRevTT(a,b) = DivTT(a,b)
              let inline dfTensorRevTC(a,b) = DivTTConst(a,b)
              let inline dfTensorRevCT(a,b) = DivTConstT(a,b)
              Tensor.OpBinary(a, b, fRaw, fTensor, dfTensorFwdTT, dfTensorFwdTC, dfTensorFwdCT, dfTensorRevTT, dfTensorRevTC, dfTensorRevCT)
          elif a.dim = 0 then
              let inline fRaw(a:RawTensor,b) = a.DivT0T(b)
              let inline fTensor(a,b) = a / b
              let inline dfTensorFwdTT(cp:Tensor,ap:Tensor,ad:Tensor,bp:Tensor,bd:Tensor) = (ad - bd * cp) / bp
              let inline dfTensorFwdTC(cp:Tensor,ap:Tensor,ad:Tensor) = ad / b
              let inline dfTensorFwdCT(cp:Tensor,bp:Tensor,bd:Tensor) = -bd * cp / bp
              let inline dfTensorRevTT(a,b) = DivT0T(a,b)
              let inline dfTensorRevTC(a,b) = DivT0TConst(a,b)
              let inline dfTensorRevCT(a,b) = DivT0ConstT(a,b)
              Tensor.OpBinary(a, b, fRaw, fTensor, dfTensorFwdTT, dfTensorFwdTC, dfTensorFwdCT, dfTensorRevTT, dfTensorRevTC, dfTensorRevCT)
          elif b.dim = 0 then
              let inline fRaw(a:RawTensor,b) = a.DivTT0(b)
              let inline fTensor(a:Tensor,b:Tensor) = a / b
              let inline dfTensorFwdTT(cp:Tensor,ap:Tensor,ad:Tensor,bp:Tensor,bd:Tensor) = (ad - bd * cp) / bp
              let inline dfTensorFwdTC(cp:Tensor,ap:Tensor,ad:Tensor) = ad / b
              let inline dfTensorFwdCT(cp:Tensor,bp:Tensor,bd:Tensor) = -bd * cp / bp
              let inline dfTensorRevTT(a,b) = DivTT0(a,b)
              let inline dfTensorRevTC(a,b) = DivTT0Const(a,b)
              let inline dfTensorRevCT(a,b) = DivTConstT0(a,b)
              Tensor.OpBinary(a, b, fRaw, fTensor, dfTensorFwdTT, dfTensorFwdTC, dfTensorFwdCT, dfTensorRevTT, dfTensorRevTC, dfTensorRevCT)
          else
              let newShape = broadcastShapes2 a.shape b.shape
  
negative.code:             let bCast = b.cast(tnew)
              aCast - bCast
          elif a.shape = b.shape then
              let fRaw(a:RawTensor,b) = a.SubTT(b)
              let fTensor(a,b) = a - b
              let dfTensorFwdTT(cp,ap,ad,bp,bd) = ad - bd
              let dfTensorFwdTC(cp,ap,ad) = ad
              let dfTensorFwdCT(cp,bp,bd) = -bd
              let dfTensorRevTT(a,b) = SubTT(a,b)
              let dfTensorRevTC(a,b) = SubTTConst(a)
              let dfTensorRevCT(a,b) = SubTConstT(b)
              Tensor.OpBinary(a, b, fRaw, fTensor, dfTensorFwdTT, dfTensorFwdTC, dfTensorFwdCT, dfTensorRevTT, dfTensorRevTC, dfTensorRevCT)
          elif a.dim = 0 then
              let fRaw(a:RawTensor,b) = a.SubT0T(b)
              let fTensor(a,b) = a - b
              let dfTensorFwdTT(cp,ap,ad,bp,bd) = ad - bd
              let dfTensorFwdTC(cp,ap,ad:Tensor) = ad.expand(b.shape)
              let dfTensorFwdCT(cp,bp,bd) = -bd
              let dfTensorRevTT(a,b) = SubT0T(a,b)
              let dfTensorRevTC(a,b) = SubT0TConst(a)
              let dfTensorRevCT(a,b) = SubT0ConstT(b)
              Tensor.OpBinary(a, b, fRaw, fTensor, dfTensorFwdTT, dfTensorFwdTC, dfTensorFwdCT, dfTensorRevTT, dfTensorRevTC, dfTensorRevCT)
          elif b.dim = 0 then
              let fRaw(a:RawTensor,b) = a.SubTT0(b)
              let fTensor(a,b) = a - b
              let dfTensorFwdTT(cp,ap,ad,bp,bd) = ad - bd
              let dfTensorFwdTC(cp,ap,ad) = ad
              let dfTensorFwdCT(cp,bp,bd:Tensor) = (-bd).expand(a.shape)
              let dfTensorRevTT(a,b) = SubTT0(a,b)
              let dfTensorRevTC(a,b) = SubTT0Const(a)
              let dfTensorRevCT(a,b) = SubTConstT0(b)
              Tensor.OpBinary(a, b, fRaw, fTensor, dfTensorFwdTT, dfTensorFwdTC, dfTensorFwdCT, dfTensorRevTT, dfTensorRevTC, dfTensorRevCT)
          else
              let newShape = broadcastShapes2 a.shape b.shape
  