Skip to content

Commit 55a77fd

Browse files
committed
test fixes and ref fixes
1 parent 03c8268 commit 55a77fd

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

src/libraries/System.Numerics.Tensors/ref/System.Numerics.Tensors.netcore.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ namespace System.Buffers
5555
}
5656
namespace System.Numerics.Tensors
5757
{
58-
public partial interface IReadOnlyTensor<TSelf, T> : System.Collections.Generic.IEnumerable<T>, System.Collections.IEnumerable where TSelf : System.Numerics.Tensors.IReadOnlyTensor<TSelf, T>
58+
public partial interface IReadOnlyTensor<TSelf, T> : System.Collections.Generic.IEnumerable<T>, System.Collections.IEnumerable where TSelf : System.Numerics.Tensors.IReadOnlyTensor<TSelf, T>
5959
{
6060
static abstract TSelf? Empty { get; }
6161
nint FlattenedLength { get; }
@@ -707,7 +707,7 @@ public void Clear() { }
707707
public void CopyTo(scoped System.Numerics.Tensors.TensorSpan<T> destination) { }
708708
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
709709
[System.ObsoleteAttribute("Equals() on TensorSpan will always throw an exception. Use the equality operator instead.")]
710-
#pragma warning disable CS0809 // Obsolete member overrides non-obsolete member
710+
#pragma warning disable CS0809 // Obsolete member overrides non-obsolete member
711711
public override bool Equals(object? obj) { throw null; }
712712
#pragma warning restore CS0809 // Obsolete member overrides non-obsolete member
713713
public void Fill(T value) { }

src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/ReadOnlyTensorSpan.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public ReadOnlyTensorSpan(T[]? array, int start, scoped ReadOnlySpan<nint> lengt
105105
}
106106
else
107107
{
108-
if (((uint)start > (uint)array.Length || (uint)maxElements > (uint)(array.Length - start)) && array.Length != 0)
108+
if (((uint)start > (uint)array.Length || (uint)maxElements >= (uint)(array.Length - start)) && array.Length != 0)
109109
ThrowHelper.ThrowArgument_InvalidStridesAndLengths();
110110
}
111111

@@ -196,7 +196,7 @@ public ReadOnlyTensorSpan(Array? array, scoped ReadOnlySpan<int> start, scoped R
196196
}
197197
else
198198
{
199-
if (((uint)startOffset > (uint)array.Length || (uint)maxElements > (uint)(array.Length - startOffset)) && array.Length != 0)
199+
if (((uint)startOffset > (uint)array.Length || (uint)maxElements >= (uint)(array.Length - startOffset)) && array.Length != 0)
200200
ThrowHelper.ThrowArgumentOutOfRangeException();
201201
}
202202

@@ -245,7 +245,7 @@ public ReadOnlyTensorSpan(Array? array, scoped ReadOnlySpan<NIndex> startIndex,
245245
}
246246
else
247247
{
248-
if ((uint)startOffset > (uint)array.Length || (uint)maxElements > (uint)(array.Length - startOffset))
248+
if ((uint)startOffset > (uint)array.Length || (uint)maxElements >= (uint)(array.Length - startOffset))
249249
ThrowHelper.ThrowArgumentOutOfRangeException();
250250
}
251251

src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/Tensor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ internal Tensor(T[]? values, ReadOnlySpan<nint> lengths, ReadOnlySpan<nint> stri
7575
}
7676
else
7777
{
78-
if (((uint)maxElements > (uint)(values.Length)) && values.Length != 0)
78+
if (((uint)maxElements >= (uint)(values.Length)) && values.Length != 0)
7979
ThrowHelper.ThrowArgument_InvalidStridesAndLengths();
8080
}
8181

src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorSpan.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public TensorSpan(T[]? array, int start, scoped ReadOnlySpan<nint> lengths, scop
107107
}
108108
else
109109
{
110-
if (((uint)start > (uint)array.Length || (uint)maxElements > (uint)(array.Length - start)) && array.Length != 0)
110+
if (((uint)start > (uint)array.Length || (uint)maxElements >= (uint)(array.Length - start)) && array.Length != 0)
111111
ThrowHelper.ThrowArgument_InvalidStridesAndLengths();
112112
}
113113

@@ -200,7 +200,7 @@ public TensorSpan(Array? array, scoped ReadOnlySpan<int> start, scoped ReadOnlyS
200200
}
201201
else
202202
{
203-
if (((uint)startOffset > (uint)array.Length || (uint)maxElements > (uint)(array.Length - startOffset)) && array.Length != 0)
203+
if (((uint)startOffset > (uint)array.Length || (uint)maxElements >= (uint)(array.Length - startOffset)) && array.Length != 0)
204204
ThrowHelper.ThrowArgumentOutOfRangeException();
205205
}
206206

@@ -248,7 +248,7 @@ public TensorSpan(Array? array, scoped ReadOnlySpan<NIndex> startIndex, scoped R
248248
}
249249
else
250250
{
251-
if ((uint)startOffset > (uint)array.Length || (uint)maxElements > (uint)(array.Length - startOffset))
251+
if ((uint)startOffset > (uint)array.Length || (uint)maxElements >= (uint)(array.Length - startOffset))
252252
ThrowHelper.ThrowArgumentOutOfRangeException();
253253
}
254254

0 commit comments

Comments
 (0)