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 result        
  
      override t.ViewT(shape:int[]) =
          if shapeLength t.Shape <> shapeLength shape then invalidOp <| sprintf "Cannot view Tensor of shape %A as shape %A" t.Shape shape
          let result = Array.copy t.Values
          upcast RawTensorFloat32CPU(result, shape)
  
  
negative.code:                 let t = RawTensorFloat32CPU.Zeros(tshape)
                  t.AddTTSlice([|0; 0; padding|], t1) :?> RawTensorFloat32CPU
              else
                  failwithf "Expecting padding >= 0, received %A" padding
          let batchSize = t1.Shape.[0]
          let inputChannels = t1.Shape.[1]
          let inputLength = t1.Shape.[2]
          let outputChannels = t2.Shape.[0]
          if t2.Shape.[1] <> inputChannels then failwithf "Input and filters have different num_channels: %A, %A" inputChannels t2.Shape.[1]
          let kernelLength = t2.Shape.[2]
          if kernelLength > inputLength then failwithf "Expecting kernelLength <= inputLength, received %A, %A" kernelLength inputLength
          let outputLength = inputLength - kernelLength + 1
          let outputShape = [|batchSize; outputChannels; outputLength|]
          let result = RawTensorFloat32CPU.Zeros(outputShape)
  