diff --git a/eng/resolveContract.targets b/eng/resolveContract.targets
index 907d690f5def7b..14bf17e8ed4f93 100644
--- a/eng/resolveContract.targets
+++ b/eng/resolveContract.targets
@@ -126,7 +126,7 @@
$(RepositoryEngineeringDir)DefaultGenApiDocIds.txt
$(RepositoryEngineeringDir)LicenseHeader.txt
- $([MSBuild]::NormalizePath('$(MSBuildProjectDirectory)', '..', 'ref', '$(AssemblyName).cs'))
+ $([MSBuild]::NormalizePath('$(MSBuildProjectDirectory)', '..', 'ref', '$(AssemblyName).cs'))
$(LangVersion)
$(CoreLibProject)
diff --git a/src/libraries/System.Numerics.Tensors/ref/System.Numerics.Tensors.csproj b/src/libraries/System.Numerics.Tensors/ref/System.Numerics.Tensors.csproj
index b29997b584e52d..3f78270ba33f08 100644
--- a/src/libraries/System.Numerics.Tensors/ref/System.Numerics.Tensors.csproj
+++ b/src/libraries/System.Numerics.Tensors/ref/System.Numerics.Tensors.csproj
@@ -3,6 +3,8 @@
$(NetCoreAppCurrent);$(NetCoreAppPrevious);$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum)
true
+
+ $(NoWarn);SYSLIB5001
@@ -21,4 +23,4 @@
-
\ No newline at end of file
+
diff --git a/src/libraries/System.Numerics.Tensors/ref/System.Numerics.Tensors.net9.cs b/src/libraries/System.Numerics.Tensors/ref/System.Numerics.Tensors.net9.cs
index 268bd7c0731890..74f068d61918d3 100644
--- a/src/libraries/System.Numerics.Tensors/ref/System.Numerics.Tensors.net9.cs
+++ b/src/libraries/System.Numerics.Tensors/ref/System.Numerics.Tensors.net9.cs
@@ -11,4 +11,20 @@ public static partial class TensorPrimitives
public static void ConvertToIntegerNative(System.ReadOnlySpan source, System.Span destination) where TFrom : System.Numerics.IFloatingPoint where TTo : System.Numerics.IBinaryInteger { }
public static void ConvertToInteger(System.ReadOnlySpan source, System.Span destination) where TFrom : System.Numerics.IFloatingPoint where TTo : System.Numerics.IBinaryInteger { }
}
+ public readonly ref partial struct ReadOnlyTensorDimensionSpan
+ {
+ public ref partial struct Enumerator : System.Collections.Generic.IEnumerator>, System.Collections.IEnumerator, System.IDisposable
+ {
+ readonly object? System.Collections.IEnumerator.Current { get { throw null; } }
+ void System.IDisposable.Dispose() { }
+ }
+ }
+ public readonly ref partial struct TensorDimensionSpan
+ {
+ public ref partial struct Enumerator : System.Collections.Generic.IEnumerator>, System.Collections.IEnumerator, System.IDisposable
+ {
+ readonly object? System.Collections.IEnumerator.Current { get { throw null; } }
+ void System.IDisposable.Dispose() { }
+ }
+ }
}
diff --git a/src/libraries/System.Numerics.Tensors/ref/System.Numerics.Tensors.netcore.cs b/src/libraries/System.Numerics.Tensors/ref/System.Numerics.Tensors.netcore.cs
index 038b107fd80e94..a91431b35fcf0e 100644
--- a/src/libraries/System.Numerics.Tensors/ref/System.Numerics.Tensors.netcore.cs
+++ b/src/libraries/System.Numerics.Tensors/ref/System.Numerics.Tensors.netcore.cs
@@ -6,7 +6,7 @@
namespace System.Buffers
{
- [System.Diagnostics.CodeAnalysis.Experimental("SYSLIB5001", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
+ [System.Diagnostics.CodeAnalysis.ExperimentalAttribute("SYSLIB5001", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public readonly partial struct NIndex : System.IEquatable
{
private readonly int _dummyPrimitive;
@@ -30,7 +30,7 @@ namespace System.Buffers
public System.Index ToIndexUnchecked() { throw null; }
public override string ToString() { throw null; }
}
- [System.Diagnostics.CodeAnalysis.Experimental("SYSLIB5001", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
+ [System.Diagnostics.CodeAnalysis.ExperimentalAttribute("SYSLIB5001", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public readonly partial struct NRange : System.IEquatable
{
private readonly int _dummyPrimitive;
@@ -63,8 +63,8 @@ public partial interface IReadOnlyTensor
bool IsDense { get; }
bool IsEmpty { get; }
bool IsPinned { get; }
- object this[params scoped System.ReadOnlySpan indexes] { get; }
- object this[params scoped System.ReadOnlySpan indexes] { get; }
+ object? this[params scoped System.ReadOnlySpan indexes] { get; }
+ object? this[params scoped System.ReadOnlySpan indexes] { get; }
[System.Diagnostics.CodeAnalysis.UnscopedRefAttribute]
System.ReadOnlySpan Lengths { get; }
int Rank { get; }
@@ -75,39 +75,40 @@ public partial interface IReadOnlyTensor
[System.Diagnostics.CodeAnalysis.ExperimentalAttribute("SYSLIB5001", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public partial interface IReadOnlyTensor : System.Collections.Generic.IEnumerable, System.Collections.IEnumerable, System.Numerics.Tensors.IReadOnlyTensor where TSelf : System.Numerics.Tensors.IReadOnlyTensor
{
- static abstract TSelf? Empty { get; }
- new T this[params scoped System.ReadOnlySpan indexes] { get; }
+ static abstract TSelf Empty { get; }
+ new ref readonly T this[params scoped System.ReadOnlySpan indexes] { get; }
TSelf this[params scoped System.ReadOnlySpan ranges] { get; }
- new T this[params scoped System.ReadOnlySpan indexes] { get; }
+ new ref readonly T this[params scoped System.ReadOnlySpan indexes] { get; }
System.Numerics.Tensors.ReadOnlyTensorSpan AsReadOnlyTensorSpan();
System.Numerics.Tensors.ReadOnlyTensorSpan AsReadOnlyTensorSpan(params scoped System.ReadOnlySpan startIndexes);
System.Numerics.Tensors.ReadOnlyTensorSpan AsReadOnlyTensorSpan(params scoped System.ReadOnlySpan ranges);
System.Numerics.Tensors.ReadOnlyTensorSpan AsReadOnlyTensorSpan(params scoped System.ReadOnlySpan startIndexes);
- void CopyTo(scoped System.Numerics.Tensors.TensorSpan destination);
+ void CopyTo(scoped in System.Numerics.Tensors.TensorSpan destination);
void FlattenTo(scoped System.Span destination);
+ System.Numerics.Tensors.ReadOnlyTensorDimensionSpan GetDimensionSpan(int dimension);
ref readonly T GetPinnableReference();
TSelf Slice(params scoped System.ReadOnlySpan startIndexes);
TSelf Slice(params scoped System.ReadOnlySpan ranges);
TSelf Slice(params scoped System.ReadOnlySpan startIndexes);
TSelf ToDenseTensor();
- bool TryCopyTo(scoped System.Numerics.Tensors.TensorSpan destination);
+ bool TryCopyTo(scoped in System.Numerics.Tensors.TensorSpan destination);
bool TryFlattenTo(scoped System.Span destination);
}
[System.Diagnostics.CodeAnalysis.ExperimentalAttribute("SYSLIB5001", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public partial interface ITensor : System.Numerics.Tensors.IReadOnlyTensor
{
bool IsReadOnly { get; }
- new object this[params scoped System.ReadOnlySpan indexes] { get; set; }
- new object this[params scoped System.ReadOnlySpan indexes] { get; set; }
+ new object? this[params scoped System.ReadOnlySpan indexes] { get; set; }
+ new object? this[params scoped System.ReadOnlySpan indexes] { get; set; }
void Clear();
void Fill(object value);
}
[System.Diagnostics.CodeAnalysis.ExperimentalAttribute("SYSLIB5001", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public partial interface ITensor : System.Collections.Generic.IEnumerable, System.Collections.IEnumerable, System.Numerics.Tensors.IReadOnlyTensor, System.Numerics.Tensors.IReadOnlyTensor, System.Numerics.Tensors.ITensor where TSelf : System.Numerics.Tensors.ITensor
{
- new T this[params scoped System.ReadOnlySpan indexes] { get; set; }
+ new ref T this[params scoped System.ReadOnlySpan indexes] { get; }
new TSelf this[params scoped System.ReadOnlySpan ranges] { get; set; }
- new T this[params scoped System.ReadOnlySpan indexes] { get; set; }
+ new ref T this[params scoped System.ReadOnlySpan indexes] { get; }
System.Numerics.Tensors.TensorSpan AsTensorSpan();
System.Numerics.Tensors.TensorSpan AsTensorSpan(params scoped System.ReadOnlySpan startIndexes);
System.Numerics.Tensors.TensorSpan AsTensorSpan(params scoped System.ReadOnlySpan ranges);
@@ -117,9 +118,26 @@ public partial interface ITensor : System.Collections.Generic.IEnumera
static abstract TSelf CreateUninitialized(scoped System.ReadOnlySpan lengths, bool pinned = false);
static abstract TSelf CreateUninitialized(scoped System.ReadOnlySpan lengths, scoped System.ReadOnlySpan strides, bool pinned = false);
void Fill(T value);
+ new System.Numerics.Tensors.TensorDimensionSpan GetDimensionSpan(int dimension);
new ref T GetPinnableReference();
}
- [System.Diagnostics.CodeAnalysis.Experimental("SYSLIB5001", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
+ public readonly ref partial struct ReadOnlyTensorDimensionSpan
+ {
+ private readonly object _dummy;
+ private readonly int _dummyPrimitive;
+ public System.Numerics.Tensors.ReadOnlyTensorSpan this[nint index] { get { throw null; } }
+ public nint Length { get { throw null; } }
+ public System.Numerics.Tensors.ReadOnlyTensorDimensionSpan.Enumerator GetEnumerator() { throw null; }
+ public ref partial struct Enumerator
+ {
+ private object _dummy;
+ private int _dummyPrimitive;
+ public readonly System.Numerics.Tensors.ReadOnlyTensorSpan Current { get { throw null; } }
+ public bool MoveNext() { throw null; }
+ public void Reset() { }
+ }
+ }
+ [System.Diagnostics.CodeAnalysis.ExperimentalAttribute("SYSLIB5001", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public readonly ref partial struct ReadOnlyTensorSpan
{
private readonly object _dummy;
@@ -136,9 +154,9 @@ public readonly ref partial struct ReadOnlyTensorSpan
[System.CLSCompliantAttribute(false)]
public unsafe ReadOnlyTensorSpan(T* data, nint dataLength, scoped System.ReadOnlySpan lengths, scoped System.ReadOnlySpan strides) { throw null; }
public ReadOnlyTensorSpan(T[]? array) { throw null; }
- public ReadOnlyTensorSpan(T[]? array, scoped System.ReadOnlySpan lengths, scoped System.ReadOnlySpan strides) { throw null; }
- public ReadOnlyTensorSpan(T[]? array, scoped System.ReadOnlySpan lengths) { throw null; }
public ReadOnlyTensorSpan(T[]? array, int start, scoped System.ReadOnlySpan lengths, scoped System.ReadOnlySpan strides) { throw null; }
+ public ReadOnlyTensorSpan(T[]? array, scoped System.ReadOnlySpan lengths) { throw null; }
+ public ReadOnlyTensorSpan(T[]? array, scoped System.ReadOnlySpan lengths, scoped System.ReadOnlySpan strides) { throw null; }
public static System.Numerics.Tensors.ReadOnlyTensorSpan Empty { get { throw null; } }
public nint FlattenedLength { get { throw null; } }
public bool HasAnyDenseDimensions { get { throw null; } }
@@ -152,13 +170,15 @@ public readonly ref partial struct ReadOnlyTensorSpan
public int Rank { get { throw null; } }
[System.Diagnostics.CodeAnalysis.UnscopedRefAttribute]
public System.ReadOnlySpan Strides { get { throw null; } }
- public static System.Numerics.Tensors.ReadOnlyTensorSpan CastUp(System.Numerics.Tensors.ReadOnlyTensorSpan items) where TDerived : class?, T? { throw null; }
- public void CopyTo(scoped System.Numerics.Tensors.TensorSpan destination) { }
+ public static System.Numerics.Tensors.ReadOnlyTensorSpan CastUp(in System.Numerics.Tensors.ReadOnlyTensorSpan items) where TDerived : class?, T? { throw null; }
+ public void CopyTo(scoped in System.Numerics.Tensors.TensorSpan destination) { }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.ObsoleteAttribute("Equals() on ReadOnlyTensorSpan will always throw an exception. Use the equality operator instead.")]
#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 FlattenTo(scoped System.Span destination) { }
+ public System.Numerics.Tensors.ReadOnlyTensorDimensionSpan GetDimensionSpan(int dimension) { throw null; }
public System.Numerics.Tensors.ReadOnlyTensorSpan.Enumerator GetEnumerator() { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.ObsoleteAttribute("GetHashCode() on ReadOnlyTensorSpan will always throw an exception.")]
@@ -167,29 +187,28 @@ public void CopyTo(scoped System.Numerics.Tensors.TensorSpan destination) { }
#pragma warning restore CS0809 // Obsolete member overrides non-obsolete member
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public ref readonly T GetPinnableReference() { throw null; }
- public static bool operator ==(System.Numerics.Tensors.ReadOnlyTensorSpan left, System.Numerics.Tensors.ReadOnlyTensorSpan right) { throw null; }
+ public static bool operator ==(in System.Numerics.Tensors.ReadOnlyTensorSpan left, in System.Numerics.Tensors.ReadOnlyTensorSpan right) { throw null; }
public static implicit operator System.Numerics.Tensors.ReadOnlyTensorSpan (T[]? array) { throw null; }
- public static bool operator !=(System.Numerics.Tensors.ReadOnlyTensorSpan left, System.Numerics.Tensors.ReadOnlyTensorSpan right) { throw null; }
+ public static bool operator !=(in System.Numerics.Tensors.ReadOnlyTensorSpan left, in System.Numerics.Tensors.ReadOnlyTensorSpan right) { throw null; }
public System.Numerics.Tensors.ReadOnlyTensorSpan Slice(params scoped System.ReadOnlySpan startIndexes) { throw null; }
public System.Numerics.Tensors.ReadOnlyTensorSpan Slice(params scoped System.ReadOnlySpan ranges) { throw null; }
public System.Numerics.Tensors.ReadOnlyTensorSpan Slice(params scoped System.ReadOnlySpan startIndexes) { throw null; }
public override string ToString() { throw null; }
- public bool TryCopyTo(scoped System.Numerics.Tensors.TensorSpan destination) { throw null; }
+ public bool TryCopyTo(scoped in System.Numerics.Tensors.TensorSpan destination) { throw null; }
public bool TryFlattenTo(scoped System.Span destination) { throw null; }
- public void FlattenTo(scoped System.Span destination) { throw null; }
- public ref partial struct Enumerator : System.Collections.Generic.IEnumerator
+ public ref partial struct Enumerator : System.Collections.Generic.IEnumerator, System.Collections.IEnumerator, System.IDisposable
{
private object _dummy;
private int _dummyPrimitive;
public readonly ref readonly T Current { get { throw null; } }
- public bool MoveNext() { throw null; }
- public void Reset() { throw null; }
- void System.IDisposable.Dispose() { throw null; }
- readonly object? System.Collections.IEnumerator.Current { get { throw null; } }
readonly T System.Collections.Generic.IEnumerator.Current { get { throw null; } }
+ readonly object? System.Collections.IEnumerator.Current { get { throw null; } }
+ public bool MoveNext() { throw null; }
+ public void Reset() { }
+ void System.IDisposable.Dispose() { }
}
}
- [System.Diagnostics.CodeAnalysis.Experimental("SYSLIB5001", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
+ [System.Diagnostics.CodeAnalysis.ExperimentalAttribute("SYSLIB5001", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public static partial class Tensor
{
public static System.Numerics.Tensors.Tensor Abs(in System.Numerics.Tensors.ReadOnlyTensorSpan x) where T : System.Numerics.INumberBase { throw null; }
@@ -211,13 +230,13 @@ public static partial class Tensor
public static System.Numerics.Tensors.Tensor Asin(in System.Numerics.Tensors.ReadOnlyTensorSpan x) where T : System.Numerics.ITrigonometricFunctions { throw null; }
public static ref readonly System.Numerics.Tensors.TensorSpan Asin(scoped in System.Numerics.Tensors.ReadOnlyTensorSpan x, in System.Numerics.Tensors.TensorSpan destination) where T : System.Numerics.ITrigonometricFunctions { throw null; }
public static System.Numerics.Tensors.ReadOnlyTensorSpan AsReadOnlyTensorSpan(this T[]? array) { throw null; }
+ public static System.Numerics.Tensors.ReadOnlyTensorSpan AsReadOnlyTensorSpan(this T[]? array, int start, scoped System.ReadOnlySpan lengths, scoped System.ReadOnlySpan strides) { throw null; }
public static System.Numerics.Tensors.ReadOnlyTensorSpan AsReadOnlyTensorSpan(this T[]? array, scoped System.ReadOnlySpan lengths) { throw null; }
public static System.Numerics.Tensors.ReadOnlyTensorSpan AsReadOnlyTensorSpan(this T[]? array, scoped System.ReadOnlySpan lengths, scoped System.ReadOnlySpan strides) { throw null; }
- public static System.Numerics.Tensors.ReadOnlyTensorSpan AsReadOnlyTensorSpan(this T[]? array, int start, scoped System.ReadOnlySpan lengths, scoped System.ReadOnlySpan strides) { throw null; }
public static System.Numerics.Tensors.TensorSpan AsTensorSpan(this T[]? array) { throw null; }
+ public static System.Numerics.Tensors.TensorSpan AsTensorSpan(this T[]? array, int start, scoped System.ReadOnlySpan lengths, scoped System.ReadOnlySpan strides) { throw null; }
public static System.Numerics.Tensors.TensorSpan AsTensorSpan(this T[]? array, scoped System.ReadOnlySpan lengths) { throw null; }
public static System.Numerics.Tensors.TensorSpan AsTensorSpan(this T[]? array, scoped System.ReadOnlySpan lengths, scoped System.ReadOnlySpan strides) { throw null; }
- public static System.Numerics.Tensors.TensorSpan AsTensorSpan(this T[]? array, int start, scoped System.ReadOnlySpan lengths, scoped System.ReadOnlySpan strides) { throw null; }
public static System.Numerics.Tensors.Tensor Atan2Pi(in System.Numerics.Tensors.ReadOnlyTensorSpan x, in System.Numerics.Tensors.ReadOnlyTensorSpan y) where T : System.Numerics.IFloatingPointIeee754 { throw null; }
public static ref readonly System.Numerics.Tensors.TensorSpan Atan2Pi(scoped in System.Numerics.Tensors.ReadOnlyTensorSpan x, scoped in System.Numerics.Tensors.ReadOnlyTensorSpan y, in System.Numerics.Tensors.TensorSpan destination) where T : System.Numerics.IFloatingPointIeee754 { throw null; }
public static System.Numerics.Tensors.Tensor Atan2Pi(in System.Numerics.Tensors.ReadOnlyTensorSpan x, T y) where T : System.Numerics.IFloatingPointIeee754 { throw null; }
@@ -287,9 +306,9 @@ public static void BroadcastTo(this System.Numerics.Tensors.Tensor source,
public static System.Numerics.Tensors.Tensor Create(scoped System.ReadOnlySpan lengths, bool pinned = false) { throw null; }
public static System.Numerics.Tensors.Tensor Create(scoped System.ReadOnlySpan lengths, scoped System.ReadOnlySpan strides, bool pinned = false) { throw null; }
public static System.Numerics.Tensors.Tensor Create(T[] array) { throw null; }
+ public static System.Numerics.Tensors.Tensor Create(T[] array, int start, scoped System.ReadOnlySpan lengths, scoped System.ReadOnlySpan strides) { throw null; }
public static System.Numerics.Tensors.Tensor Create(T[] array, scoped System.ReadOnlySpan lengths) { throw null; }
public static System.Numerics.Tensors.Tensor Create(T[] array, scoped System.ReadOnlySpan lengths, scoped System.ReadOnlySpan strides) { throw null; }
- public static System.Numerics.Tensors.Tensor Create(T[] array, int start, scoped System.ReadOnlySpan lengths, scoped System.ReadOnlySpan strides) { throw null; }
public static System.Numerics.Tensors.Tensor DegreesToRadians(in System.Numerics.Tensors.ReadOnlyTensorSpan x) where T : System.Numerics.ITrigonometricFunctions { throw null; }
public static ref readonly System.Numerics.Tensors.TensorSpan DegreesToRadians(scoped in System.Numerics.Tensors.ReadOnlyTensorSpan x, in System.Numerics.Tensors.TensorSpan destination) where T : System.Numerics.ITrigonometricFunctions { throw null; }
public static T Distance(scoped in System.Numerics.Tensors.ReadOnlyTensorSpan x, scoped in System.Numerics.Tensors.ReadOnlyTensorSpan y) where T : System.Numerics.IRootFunctions { throw null; }
@@ -455,7 +474,7 @@ public static void BroadcastTo(this System.Numerics.Tensors.Tensor source,
public static T Norm(scoped in System.Numerics.Tensors.ReadOnlyTensorSpan x) where T : System.Numerics.IRootFunctions { throw null; }
public static System.Numerics.Tensors.Tensor OnesComplement(in System.Numerics.Tensors.ReadOnlyTensorSpan x) where T : System.Numerics.IBitwiseOperators { throw null; }
public static ref readonly System.Numerics.Tensors.TensorSpan OnesComplement(scoped in System.Numerics.Tensors.ReadOnlyTensorSpan y, in System.Numerics.Tensors.TensorSpan destination) where T : System.Numerics.IBitwiseOperators { throw null; }
- public static System.Numerics.Tensors.Tensor PermuteDimensions(this System.Numerics.Tensors.Tensor tensor, scoped System.ReadOnlySpan dimensions) { throw null; }
+ public static System.Numerics.Tensors.Tensor PermuteDimensions(this System.Numerics.Tensors.Tensor tensor, System.ReadOnlySpan dimensions) { throw null; }
public static System.Numerics.Tensors.Tensor PopCount(in System.Numerics.Tensors.ReadOnlyTensorSpan x) where T : System.Numerics.IBinaryInteger { throw null; }
public static ref readonly System.Numerics.Tensors.TensorSpan PopCount(scoped in System.Numerics.Tensors.ReadOnlyTensorSpan y, in System.Numerics.Tensors.TensorSpan destination) where T : System.Numerics.IBinaryInteger { throw null; }
public static System.Numerics.Tensors.Tensor