anchor.diff:              | [| i0; i1; i2 |] -> tt.[int64 i0, int64 i1, int64 i2]
               | [| i0; i1; i2; i3 |] -> tt.[int64 i0, int64 i1, int64 i2, int64 i3]
               | _ -> tt.View(toTorchShape [|shapeLength shape|]).[int64 (indexToFlatIndex shape indexes)]
  +
  +        // Torch Tensors must be CPU before DataItem can be accessed
  +        let item = torchMoveTo item Device.CPU
  +
           let obj = 
               match dtype with 
               | Dtype.Bool -> box (item.DataItem<bool>())
  
positive.code:         t1.MakeLike(result, dtype=Dtype.Bool)
  
      override t.MaxIndexT() = 
          let res = Array.zeroCreate<int64> t.Dim
          let idxs = Array.zeroCreate t.Dim
          let mutable values = tt
  
negative.code:     let fromTorchShape (shape: int64[]) = shape |> Array.map int
  
      let inline combineHashes (h1 : int) (h2 : int) = ((h1 <<< 5) + h1) ^^^ h2
  
      let torchMoveTo (tt: TorchTensor) device =
          match device with 
          | Device.CPU -> tt.Cpu()
          | Device.GPU -> tt.Cuda()
          | _ -> invalidOp (sprintf "the device '%A' is not supported by the Torch backend" device)
  
      type RawTensor with
          member x.TorchTensor = (x :?> TorchRawTensor).TorchTensor
  