anchor.diff:      override t.ToValue() =
           match t.Dim with
           | 0 -> upcast t.Values.[0]
  -        | _ -> invalidOp (sprintf "Cannot convert %Ad Tensor to scalar" t.Dim)
  +        | _ -> failwithf "Cannot convert %Ad Tensor to scalar" t.Dim
   
       override t.ToArray() =
           match t.Dim with
  -        | 0 -> invalidOp "Cannot convert 0d Tensor to array"
  +        | 0 -> failwith "Cannot convert 0d Tensor to array"
           | 1 -> upcast Array.init t.Shape.[0] (fun i -> t.[i])
           | 2 -> upcast Array2D.init t.Shape.[0] t.Shape.[1] (fun i j -> t.[i, j])
           | 3 -> upcast Array3D.init t.Shape.[0] t.Shape.[1] t.Shape.[2] (fun i j k -> t.[i, j, k])
           | 4 -> upcast Array4D.init t.Shape.[0] t.Shape.[1] t.Shape.[2] t.Shape.[3] (fun i j k l -> t.[i, j, k, l])
  -        | _ -> invalidOp (sprintf "Cannot get array for Tensor dimensions > 4. Consider slicing the Tensor. Shape: %A" t.Shape)
  +        | _ -> failwithf "Cannot get array for Tensor dimensions > 4. Consider slicing the Tensor. Shape: %A" t.Shape
   
       override t1.Equals(t2:RawTensor) = 
           match t2 with
           | :? RawTensorFloat32CPU as t2 -> t1.Shape = t2.Shape && t1.Values = t2.Values
  -        | _ -> failwith <| sprintf "Cannot compare RawTensors of different types. t1:%A, t2:%A" t1 t2
  +        | _ -> failwithf "Cannot compare RawTensors of different types. t1:%A, t2:%A" t1 t2
   
       override t1.ApproximatelyEquals(t2:RawTensor, tolerance) =
           let tolerance = float32 <| tolerance
           match t2 with
           | :? RawTensorFloat32CPU as t2 -> t1.Shape = t2.Shape && arraysApproximatelyEqual tolerance t1.Values t2.Values
  -        | _ -> failwith <| sprintf "Cannot compare RawTensors of different types. t1:%A, t2:%A" t1 t2
  +        | _ -> failwithf "Cannot compare RawTensors of different types. t1:%A, t2:%A" t1 t2
   
       override __.StackTs(tensors) =
           let tensors = tensors |> Seq.toList
           let values, shapes = tensors |> List.map (fun t -> (t :?> RawTensorFloat32CPU).Values, t.Shape) |> List.unzip
  -        if not (allEqual shapes) then invalidArg "tensors" "Expecting Tensors with same shape"
  +        if not (allEqual shapes) then failwith "Expecting Tensors with same shape"
           let n = tensors |> List.length
           let m = shapeLength shapes.[0]
           let result = Array.create (n * m) 0.f
  
positive.code:         upcast RawTensorFloat32CPU(result, t1.Shape)
  
      override t1.MatMulT2T2(t2) =
          if t1.Dim <> 2 || t2.Dim <> 2 then invalidOp <| sprintf "Expecting two 2d Tensors, received Tensors with shapes %A, %A" t1.Shape t2.Shape
          let t1rows, t1cols = t1.Shape.[0], t1.Shape.[1]
          let t2rows, t2cols = t2.Shape.[0], t2.Shape.[1]
          if t1cols <> t2rows then invalidOp <| sprintf "Cannot multiply Tensors with shapes %A, %A" t1.Shape t2.Shape
          let t1value = t1.Values
          let t2value = (t2 :?> RawTensorFloat32CPU).Values        
          let result = Array2D.init t1rows t2cols (fun i j -> Array.sumBy (fun k -> t1value.[i*t1cols + k] * t2value.[k*t2cols + j]) [|0..(t2rows-1)|] )
  
negative.code:                 if notNull array then 
                      RawTensorFloat32CPU(array |> Array.map float32, shape)
                  else
                      failwith "Cannot convert value to RawTensorFloat32CPU"
  
      override t1.LtTT(t2) =
          let t1value = t1.Values
  