anchor.diff:              let bCast = b.cast(tnew)
               aCast - bCast
           elif a.shape = b.shape then
  -            let inline fRaw(a:RawTensor,b) = a.SubTT(b)
  -            let inline fTensor(a,b) = a - b
  -            let inline dfTensorFwdTT(cp,ap,ad,bp,bd) = ad - bd
  -            let inline dfTensorFwdTC(cp,ap,ad) = ad
  -            let inline dfTensorFwdCT(cp,bp,bd) = -bd
  -            let inline dfTensorRevTT(a,b) = SubTT(a,b)
  -            let inline dfTensorRevTC(a,b) = SubTTConst(a)
  -            let inline dfTensorRevCT(a,b) = SubTConstT(b)
  +            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 inline fRaw(a:RawTensor,b) = a.SubT0T(b)
  -            let inline fTensor(a,b) = a - b
  -            let inline dfTensorFwdTT(cp,ap,ad,bp,bd) = ad - bd
  -            let inline dfTensorFwdTC(cp,ap,ad:Tensor) = ad.expand(b.shape)
  -            let inline dfTensorFwdCT(cp,bp,bd) = -bd
  -            let inline dfTensorRevTT(a,b) = SubT0T(a,b)
  -            let inline dfTensorRevTC(a,b) = SubT0TConst(a)
  -            let inline dfTensorRevCT(a,b) = SubT0ConstT(b)
  +            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 inline fRaw(a:RawTensor,b) = a.SubTT0(b)
  -            let inline fTensor(a,b) = a - b
  -            let inline dfTensorFwdTT(cp,ap,ad,bp,bd) = ad - bd
  -            let inline dfTensorFwdTC(cp,ap,ad) = ad
  -            let inline dfTensorFwdCT(cp,bp,bd:Tensor) = (-bd).expand(a.shape)
  -            let inline dfTensorRevTT(a,b) = SubTT0(a,b)
  -            let inline dfTensorRevTC(a,b) = SubTT0Const(a)
  -            let inline dfTensorRevCT(a,b) = SubTConstT0(b)
  +            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
  
positive.code:             let bCast = b.cast(tnew)
              aCast + bCast
          elif a.shape = b.shape then
              let inline fRaw(a:RawTensor,b) = a.AddTT(b)
              let inline fTensor(a,b) = a + b
              let inline dfTensorFwdTT(cp,ap,ad,bp:Tensor,bd:Tensor) = ad + bd
              let inline dfTensorFwdTC(cp,ap,ad) = ad
              let inline dfTensorFwdCT(cp,bp,bd) = bd
              let inline dfTensorRevTT(a,b) = AddTT(a,b)
              let inline dfTensorRevTC(a,b) = AddTTConst(a)
              let inline dfTensorRevCT(a,b) = AddTTConst(b)
              Tensor.OpBinary(a, b, fRaw, fTensor, dfTensorFwdTT, dfTensorFwdTC, dfTensorFwdCT, dfTensorRevTT, dfTensorRevTC, dfTensorRevCT)
          elif a.dim = 0 then
              let inline fRaw(a,b:RawTensor) = b.AddTT0(a)
              let inline fTensor(a,b) = a + b
              let inline dfTensorFwdTT(cp,ap,ad,bp:Tensor,bd:Tensor) = ad + bd
              let inline dfTensorFwdTC(cp,ap,ad:Tensor) = ad.expand(b.shape)
              let inline dfTensorFwdCT(cp,bp,bd) = bd
              let inline dfTensorRevTT(a,b) = AddTT0(b,a)
              let inline dfTensorRevTC(a,b) = AddTConstT0(a)
              let inline dfTensorRevCT(a,b) = AddTT0Const(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.AddTT0(b)
              let inline fTensor(a,b) = a + b
              let inline dfTensorFwdTT(cp,ap,ad,bp:Tensor,bd:Tensor) = ad + bd
              let inline dfTensorFwdTC(cp,ap,ad) = ad
              let inline dfTensorFwdCT(cp,bp,bd:Tensor) = bd.expand(a.shape)
              let inline dfTensorRevTT(a,b) = AddTT0(a,b)
              let inline dfTensorRevTC(a,b) = AddTT0Const(a)
              let inline dfTensorRevCT(a,b) = AddTConstT0(b)
              Tensor.OpBinary(a, b, fRaw, fTensor, dfTensorFwdTT, dfTensorFwdTC, dfTensorFwdCT, dfTensorRevTT, dfTensorRevTC, dfTensorRevCT)
          elif a.dim = 2 && b.dim = 1 && a.shape.[1] = b.shape.[0] then
              let inline fRaw(a:RawTensor,b) = a.AddT2T1(b)
              let inline fTensor(a,b) = a + b
              let inline dfTensorFwdTT(cp,ap,ad,bp:Tensor,bd:Tensor) = ad + bd
              let inline dfTensorFwdTC(cp,ap,ad) = ad
              let inline dfTensorFwdCT(cp:Tensor,bp:Tensor,bd:Tensor) = cp.zerosLike() + bd
              let inline dfTensorRevTT(a,b) = AddT2T1(a,b)
              let inline dfTensorRevTC(a,b) = AddT2T1Const(a)
              let inline dfTensorRevCT(a,b) = AddT2ConstT1(b)
              Tensor.OpBinary(a, b, fRaw, fTensor, dfTensorFwdTT, dfTensorFwdTC, dfTensorFwdCT, dfTensorRevTT, dfTensorRevTC, dfTensorRevCT)
          elif a.dim = 1 && b.dim = 2 && a.shape.[0] = b.shape.[1] then
              let inline fRaw(a,b:RawTensor) = b.AddT2T1(a)
              let inline fTensor(a,b) = a + b
              let inline dfTensorFwdTT(cp,ap,ad,bp:Tensor,bd:Tensor) = ad + bd
              let inline dfTensorFwdTC(cp:Tensor,ap,ad) = ad + cp.zerosLike()
              let inline dfTensorFwdCT(cp,bp,bd) = bd
              let inline dfTensorRevTT(a,b) = AddT2T1(b,a)
              let inline dfTensorRevTC(a,b) = AddT2ConstT1(a)
              let inline dfTensorRevCT(a,b) = AddT2T1Const(b)
              Tensor.OpBinary(a, b, fRaw, fTensor, dfTensorFwdTT, dfTensorFwdTC, dfTensorFwdCT, dfTensorRevTT, dfTensorRevTC, dfTensorRevCT)
          else
              let newShape = broadcastShapes2 a.shape b.shape
  
negative.code:         let mutable b = b
          if dilations.[0] > 1 || dilations.[1] > 1 then
              b <- b.dilate([|1; 1; dilations.[0]; dilations.[1]|])
          let fRaw(a:RawTensor,b) = a.Conv2D(b, strides, paddings)
          let fTensor(a:Tensor,b) = a.conv2d(b, strides=strides, paddings=paddings)
          let dfTensorFwdTT(cp,ap:Tensor,ad:Tensor,bp,bd) = ad.conv2d(bp, strides=strides, paddings=paddings) + ap.conv2d(bd, strides=strides, paddings=paddings)
          let dfTensorFwdTC(cp,ap,ad:Tensor) = ad.conv2d(b, strides=strides, paddings=paddings)
          let dfTensorFwdCT(cp,bp,bd) = a.conv2d(bd, strides=strides, paddings=paddings)
          let dfTensorRevTT(a,b) = Conv2DTT(a,b, strides, paddings)
          let dfTensorRevTC(a,b) = Conv2DTTConst(a,b, strides, paddings)
          let dfTensorRevCT(a,b) = Conv2DTConstT(a,b, strides, paddings)
          Tensor.OpBinary(a, b, fRaw, fTensor, dfTensorFwdTT, dfTensorFwdTC, dfTensorFwdCT, dfTensorRevTT, dfTensorRevTC, dfTensorRevCT)
  
      // a: input, NxCxHxW (batchSize x inputChannels x inputHeight x inputWidth)
  