Skip to content

Commit

Permalink
test fixes and ref fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelgsharp committed Jun 7, 2024
1 parent 03c8268 commit 55a77fd
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ namespace System.Buffers
}
namespace System.Numerics.Tensors
{
public partial interface IReadOnlyTensor<TSelf, T> : System.Collections.Generic.IEnumerable<T>, System.Collections.IEnumerable where TSelf : System.Numerics.Tensors.IReadOnlyTensor<TSelf, T>
public partial interface IReadOnlyTensor<TSelf, T> : System.Collections.Generic.IEnumerable<T>, System.Collections.IEnumerable where TSelf : System.Numerics.Tensors.IReadOnlyTensor<TSelf, T>
{
static abstract TSelf? Empty { get; }
nint FlattenedLength { get; }
Expand Down Expand Up @@ -707,7 +707,7 @@ public void Clear() { }
public void CopyTo(scoped System.Numerics.Tensors.TensorSpan<T> destination) { }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.ObsoleteAttribute("Equals() on TensorSpan will always throw an exception. Use the equality operator instead.")]
#pragma warning disable CS0809 // Obsolete member overrides non-obsolete member
#pragma warning disable CS0809 // Obsolete member overrides non-obsolete member
public override bool Equals(object? obj) { throw null; }
#pragma warning restore CS0809 // Obsolete member overrides non-obsolete member
public void Fill(T value) { }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public ReadOnlyTensorSpan(T[]? array, int start, scoped ReadOnlySpan<nint> lengt
}
else
{
if (((uint)start > (uint)array.Length || (uint)maxElements > (uint)(array.Length - start)) && array.Length != 0)
if (((uint)start > (uint)array.Length || (uint)maxElements >= (uint)(array.Length - start)) && array.Length != 0)
ThrowHelper.ThrowArgument_InvalidStridesAndLengths();
}

Expand Down Expand Up @@ -196,7 +196,7 @@ public ReadOnlyTensorSpan(Array? array, scoped ReadOnlySpan<int> start, scoped R
}
else
{
if (((uint)startOffset > (uint)array.Length || (uint)maxElements > (uint)(array.Length - startOffset)) && array.Length != 0)
if (((uint)startOffset > (uint)array.Length || (uint)maxElements >= (uint)(array.Length - startOffset)) && array.Length != 0)
ThrowHelper.ThrowArgumentOutOfRangeException();
}

Expand Down Expand Up @@ -245,7 +245,7 @@ public ReadOnlyTensorSpan(Array? array, scoped ReadOnlySpan<NIndex> startIndex,
}
else
{
if ((uint)startOffset > (uint)array.Length || (uint)maxElements > (uint)(array.Length - startOffset))
if ((uint)startOffset > (uint)array.Length || (uint)maxElements >= (uint)(array.Length - startOffset))
ThrowHelper.ThrowArgumentOutOfRangeException();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ internal Tensor(T[]? values, ReadOnlySpan<nint> lengths, ReadOnlySpan<nint> stri
}
else
{
if (((uint)maxElements > (uint)(values.Length)) && values.Length != 0)
if (((uint)maxElements >= (uint)(values.Length)) && values.Length != 0)
ThrowHelper.ThrowArgument_InvalidStridesAndLengths();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public TensorSpan(T[]? array, int start, scoped ReadOnlySpan<nint> lengths, scop
}
else
{
if (((uint)start > (uint)array.Length || (uint)maxElements > (uint)(array.Length - start)) && array.Length != 0)
if (((uint)start > (uint)array.Length || (uint)maxElements >= (uint)(array.Length - start)) && array.Length != 0)
ThrowHelper.ThrowArgument_InvalidStridesAndLengths();
}

Expand Down Expand Up @@ -200,7 +200,7 @@ public TensorSpan(Array? array, scoped ReadOnlySpan<int> start, scoped ReadOnlyS
}
else
{
if (((uint)startOffset > (uint)array.Length || (uint)maxElements > (uint)(array.Length - startOffset)) && array.Length != 0)
if (((uint)startOffset > (uint)array.Length || (uint)maxElements >= (uint)(array.Length - startOffset)) && array.Length != 0)
ThrowHelper.ThrowArgumentOutOfRangeException();
}

Expand Down Expand Up @@ -248,7 +248,7 @@ public TensorSpan(Array? array, scoped ReadOnlySpan<NIndex> startIndex, scoped R
}
else
{
if ((uint)startOffset > (uint)array.Length || (uint)maxElements > (uint)(array.Length - startOffset))
if ((uint)startOffset > (uint)array.Length || (uint)maxElements >= (uint)(array.Length - startOffset))
ThrowHelper.ThrowArgumentOutOfRangeException();
}

Expand Down

0 comments on commit 55a77fd

Please sign in to comment.