anchor.diff:          let shape1 = t1.Shape
           let shape2 = t2.Shape
           let expandedShape2 = Shape.unsqueezeAs shape2 shape1
  -        let t2Expanded = t2.TorchTensor.Expand(toTorchShape expandedShape2)
  +        let t2Expanded = t2.TorchTensor.expand(toTorchShape expandedShape2)
           let mutable t1Slice = tt // will share memory with res
           for d in 0 .. location.Length - 1 do 
               let len2 = expandedShape2.[d]
               if location.[d] <> 0 || len2 <> shape1.[d] then 
  -                t1Slice <- t1Slice.Narrow(int64 d, int64 location.[d], int64 len2)
  -        t1Slice.AddInPlace(t2Expanded) |> ignore
  -
  -    override _.SubInPlace(t2) = checkMutable(); tt.SubInPlace(t2.TorchTensor) |> ignore
  -
  -    override _.SubScalarInPlace(t2) = checkMutable(); tt.SubInPlace(toTorchScalar t2) |> ignore
  -
  -    override _.MulInPlace(t2) = checkMutable(); tt.MulInPlace(t2.TorchTensor) |> ignore
  -
  -    override _.MulScalarInPlace(t2) = checkMutable(); tt.MulInPlace(toTorchScalar t2) |> ignore
  -
  -    override _.DivInPlace(t2) = checkMutable(); tt.DivInPlace(t2.TorchTensor) |> ignore
  -
  -    override _.DivScalarInPlace(t2) = checkMutable(); tt.DivInPlace(toTorchScalar t2) |> ignore
  -
  -    override _.PowInPlace(t2) = checkMutable(); tt.PowInPlace(t2.TorchTensor) |> ignore
  -
  -    override _.PowScalarInPlace(t2) = checkMutable(); tt.PowInPlace(toTorchScalar t2) |> ignore
  -
  -    override _.MatMulInPlace(t2) = checkMutable(); tt <- tt.MatMul(t2.TorchTensor) 
  -
  -    override _.NegInPlace() = checkMutable(); tt.NegInPlace() |> ignore
  -
  -    override _.SignInPlace() = checkMutable(); tt.SignInPlace() |> ignore
  -
  -    override _.FloorInPlace() = checkMutable(); tt.FloorInPlace() |> ignore
  -
  -    override _.CeilInPlace() = checkMutable(); tt.CeilInPlace() |> ignore
  -
  -    override _.RoundInPlace() = checkMutable(); tt.RoundInPlace() |> ignore
  -
  -    override _.AbsInPlace() = checkMutable(); tt.AbsInPlace() |> ignore
  -
  -    override _.ReluInPlace() = checkMutable(); tt.ReluInPlace() |> ignore
  -
  -    override _.SoftplusInPlace() = checkMutable(); tt <- tt.Softplus() 
  -
  -    override _.SigmoidInPlace() = checkMutable(); tt <- tt.Sigmoid() 
  -
  -    override _.ExpInPlace() = checkMutable(); tt <- tt.Exp()
  -
  -    override _.LogInPlace() = checkMutable(); tt.LogInPlace() |> ignore
  -
  -    override _.Log10InPlace() = checkMutable(); tt.Log10InPlace() |> ignore
  -
  -    override _.SqrtInPlace() = checkMutable(); tt.SqrtInPlace() |> ignore
  -
  -    override _.SinInPlace() = checkMutable(); tt.SinInPlace() |> ignore
  -
  -    override _.CosInPlace() = checkMutable(); tt.CosInPlace() |> ignore
  -
  -    override _.TanInPlace() = checkMutable(); tt.TanInPlace() |> ignore
  -
  -    override _.SinhInPlace() = checkMutable(); tt.SinhInPlace() |> ignore
  -
  -    override _.CoshInPlace() = checkMutable(); tt.CoshInPlace() |> ignore
  -
  -    override _.TanhInPlace() = checkMutable(); tt.TanhInPlace() |> ignore
  -
  -    override _.AsinInPlace() = checkMutable(); tt.AsinInPlace() |> ignore
  -
  -    override _.AcosInPlace() = checkMutable(); tt.AcosInPlace() |> ignore
  -
  -    override _.AtanInPlace() = checkMutable(); tt.AtanInPlace() |> ignore
  +                t1Slice <- t1Slice.narrow(int64 d, int64 location.[d], int64 len2)
  +        t1Slice.add_(t2Expanded) |> ignore
  +
  +    override _.SubInPlace(t2) = checkMutable(); tt.sub_(t2.TorchTensor) |> ignore
  +
  +    override _.SubScalarInPlace(t2) = checkMutable(); tt.sub_(toTorchScalar t2) |> ignore
  +
  +    override _.MulInPlace(t2) = checkMutable(); tt.mul_(t2.TorchTensor) |> ignore
  +
  +    override _.MulScalarInPlace(t2) = checkMutable(); tt.mul_(toTorchScalar t2) |> ignore
  +
  +    override _.DivInPlace(t2) = checkMutable(); tt.div_(t2.TorchTensor) |> ignore
  +
  +    override _.DivScalarInPlace(t2) = checkMutable(); tt.div_(toTorchScalar t2) |> ignore
  +
  +    override _.PowInPlace(t2) = checkMutable(); tt.pow_(t2.TorchTensor) |> ignore
  +
  +    override _.PowScalarInPlace(t2) = checkMutable(); tt.pow_(toTorchScalar t2) |> ignore
  +
  +    override _.MatMulInPlace(t2) = checkMutable(); tt <- tt.matmul(t2.TorchTensor) 
  +
  +    override _.NegInPlace() = checkMutable(); tt.neg_() |> ignore
  +
  +    override _.SignInPlace() = checkMutable(); tt.sign_() |> ignore
  +
  +    override _.FloorInPlace() = checkMutable(); tt.floor_() |> ignore
  +
  +    override _.CeilInPlace() = checkMutable(); tt.ceil_() |> ignore
  +
  +    override _.RoundInPlace() = checkMutable(); tt.round_() |> ignore
  +
  +    override _.AbsInPlace() = checkMutable(); tt.abs_() |> ignore
  +
  +    override _.ReluInPlace() = checkMutable(); tt.relu_() |> ignore
  +
  +    override _.SoftplusInPlace() = checkMutable(); tt <- tt.softplus() 
  +
  +    override _.SigmoidInPlace() = checkMutable(); tt <- tt.sigmoid() 
  +
  +    override _.ExpInPlace() = checkMutable(); tt <- tt.exp()
  +
  +    override _.LogInPlace() = checkMutable(); tt.log_() |> ignore
  +
  +    override _.Log10InPlace() = checkMutable(); tt.log10_() |> ignore
  +
  +    override _.SqrtInPlace() = checkMutable(); tt.sqrt_() |> ignore
  +
  +    override _.SinInPlace() = checkMutable(); tt.sin_() |> ignore
  +
  +    override _.CosInPlace() = checkMutable(); tt.cos_() |> ignore
  +
  +    override _.TanInPlace() = checkMutable(); tt.tan_() |> ignore
  +
  +    override _.SinhInPlace() = checkMutable(); tt.Sinh_() |> ignore
  +
  +    override _.CoshInPlace() = checkMutable(); tt.cosh_() |> ignore
  +
  +    override _.TanhInPlace() = checkMutable(); tt.tanh_() |> ignore
  +
  +    override _.AsinInPlace() = checkMutable(); tt.asin_() |> ignore
  +
  +    override _.AcosInPlace() = checkMutable(); tt.acos_() |> ignore
  +
  +    override _.AtanInPlace() = checkMutable(); tt.atan_() |> ignore
   
       // TODO - next version of TorchSharp will have in place version of this
       override t.OnesInPlace() = checkMutable(); tt <- (RawTensor.Ones(shape, dtype, t.Device, Backend.Torch) :?> TorchRawTensor).TorchTensor
  
positive.code: 
              let len = stop - start
              if len <> t.Shape.[i] then // Slice only when there is something to slice in this dimension
                  use idxs = Int64Tensor.Arange((int64 start).ToScalar(), (int64 stop).ToScalar(), 1L.ToScalar(), tt.DeviceType, tt.DeviceIndex)
                  res <- res.IndexSelect(int64 dim, idxs)  // yield len // if len=1 then squeeze this dimension
              if fullBounds.[i, 2] = 1 && len = 1 then 
                  res <- res.Squeeze(int64 dim)  // yield len // if len=1 then squeeze this dimension
              else
                  dim <- dim + 1
          let res = 
              if dtype = Dtype.Float16 || dtype = Dtype.BFloat16  then 
                  res.ToType(toTorchType dtype)
              else
                  res
          t.MakeLike(tt=res, shape=newShape)
  
      override t.Clone() =
          t.MakeLike(tt.Clone())
  
      override t.ComputeHash() = 
          // Torch Tensors must be CPU before Data can be accessed
  
negative.code:        if tt.Type <> toTorchType dtype then
             failwithf "mismatched Torch tensor type, expected %A, got %A" (toTorchType dtype) tt.Type
  
         if int tt.device_type <> int device.DeviceType then
             failwithf "mismatched Torch tensor device, expected %A, got %A" tt.device_type device.DeviceType
  
         if int tt.device_index <> int device.DeviceIndex then
             failwithf "mismatched Torch tensor index, expected %A, got %A" tt.device_index device.DeviceIndex
  
         if toTorchShape shape <> tt.shape then 
             failwithf "mismatched Torch tensor shape, expected %A, got %A" (toTorchShape shape) tt.shape
  
      let device = () // make sure 'device' isn't accessed in a member and stored as a field
  #endif
  