Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/project/list-of-diagnostics.md
Original file line number Diff line number Diff line change
Expand Up @@ -310,9 +310,9 @@ Diagnostic id values for experimental APIs must not be recycled, as that could s

| Diagnostic ID | Introduced | Removed | Description |
| :---------------- | ---------: | ------: | :---------- |
| __`SYSLIB5001`__ | .NET 9 | TBD | `Tensor<T>` and related APIs in System.Numerics.Tensors are experimental |
| __`SYSLIB5001`__ | .NET 9 | .NET 10 | `Tensor<T>` and related APIs in System.Numerics.Tensors are experimental |
| __`SYSLIB5002`__ | .NET 9 | TBD | `SystemColors` alternate colors are experimental |
| __`SYSLIB5003`__ | .NET 9 | TBD | `System.Runtime.Intrinsics.Arm.Sve` is experimental |
| __`SYSLIB5004`__ | .NET 9 | TBD | `X86Base.DivRem` is experimental since performance is not as optimized as `T.DivRem` |
| __`SYSLIB5005`__ | .NET 9 | TBD | `System.Formats.Nrbf` is experimental |
| __`SYSLIB5005`__ | .NET 9 | .NET 10 | `System.Formats.Nrbf` is experimental |
| __`SYSLIB5006`__ | .NET 10 | TBD | Types for Post-Quantum Cryptography (PQC) are experimental. |
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<PropertyGroup>
<TargetFrameworks>$(NetCoreAppCurrent);$(NetCoreAppPrevious);$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum)</TargetFrameworks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<!-- SYSLIB5001: Tensor<T> and related APIs in System.Numerics.Tensors are experimental in .NET 9 -->
<NoWarn>$(NoWarn);SYSLIB5001</NoWarn>
<!-- SA1001: Commas should not be preceded by a whitespace; needed due to ifdef -->
<NoWarn>$(NoWarn);SA1001</NoWarn>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@ public readonly ref partial struct ReadOnlyTensorDimensionSpan<T>
void System.IDisposable.Dispose() { }
}
}
public readonly ref partial struct ReadOnlyTensorSpan<T> : System.Numerics.Tensors.IReadOnlyTensor, System.Numerics.Tensors.IReadOnlyTensor<System.Numerics.Tensors.ReadOnlyTensorSpan<T>, T>
{
object? System.Numerics.Tensors.IReadOnlyTensor.this[params scoped System.ReadOnlySpan<System.Buffers.NIndex> indexes] { get { throw null; } }
object? System.Numerics.Tensors.IReadOnlyTensor.this[params scoped System.ReadOnlySpan<nint> indexes] { get { throw null; } }
System.Numerics.Tensors.ReadOnlyTensorSpan<T> System.Numerics.Tensors.IReadOnlyTensor<System.Numerics.Tensors.ReadOnlyTensorSpan<T>, T>.AsReadOnlyTensorSpan() { throw null; }
System.Numerics.Tensors.ReadOnlyTensorSpan<T> System.Numerics.Tensors.IReadOnlyTensor<System.Numerics.Tensors.ReadOnlyTensorSpan<T>, T>.AsReadOnlyTensorSpan(params scoped System.ReadOnlySpan<nint> startIndexes) { throw null; }
System.Numerics.Tensors.ReadOnlyTensorSpan<T> System.Numerics.Tensors.IReadOnlyTensor<System.Numerics.Tensors.ReadOnlyTensorSpan<T>, T>.AsReadOnlyTensorSpan(params scoped System.ReadOnlySpan<System.Buffers.NIndex> startIndexes) { throw null; }
System.Numerics.Tensors.ReadOnlyTensorSpan<T> System.Numerics.Tensors.IReadOnlyTensor<System.Numerics.Tensors.ReadOnlyTensorSpan<T>, T>.AsReadOnlyTensorSpan(params scoped System.ReadOnlySpan<System.Buffers.NRange> ranges) { throw null; }
System.Numerics.Tensors.ReadOnlyTensorSpan<T> System.Numerics.Tensors.IReadOnlyTensor<System.Numerics.Tensors.ReadOnlyTensorSpan<T>, T>.ToDenseTensor() { throw null; }
}
public readonly ref partial struct TensorDimensionSpan<T>
{
public ref partial struct Enumerator : System.Collections.Generic.IEnumerator<System.Numerics.Tensors.TensorSpan<T>>, System.Collections.IEnumerator, System.IDisposable
Expand All @@ -27,4 +37,31 @@ public readonly ref partial struct TensorDimensionSpan<T>
void System.IDisposable.Dispose() { }
}
}
public readonly ref partial struct TensorSpan<T> : System.Numerics.Tensors.IReadOnlyTensor, System.Numerics.Tensors.IReadOnlyTensor<System.Numerics.Tensors.TensorSpan<T>, T>, System.Numerics.Tensors.ITensor, System.Numerics.Tensors.ITensor<System.Numerics.Tensors.TensorSpan<T>, T>
{
object? System.Numerics.Tensors.IReadOnlyTensor.this[params scoped System.ReadOnlySpan<System.Buffers.NIndex> indexes] { get { throw null; } }
object? System.Numerics.Tensors.IReadOnlyTensor.this[params scoped System.ReadOnlySpan<nint> indexes] { get { throw null; } }
ref readonly T System.Numerics.Tensors.IReadOnlyTensor<System.Numerics.Tensors.TensorSpan<T>, T>.this[params scoped System.ReadOnlySpan<System.Buffers.NIndex> indexes] { get { throw null; } }
ref readonly T System.Numerics.Tensors.IReadOnlyTensor<System.Numerics.Tensors.TensorSpan<T>, T>.this[params scoped System.ReadOnlySpan<nint> indexes] { get { throw null; } }
System.Numerics.Tensors.ReadOnlyTensorSpan<T> System.Numerics.Tensors.IReadOnlyTensor<System.Numerics.Tensors.TensorSpan<T>, T>.AsReadOnlyTensorSpan() { throw null; }
System.Numerics.Tensors.ReadOnlyTensorSpan<T> System.Numerics.Tensors.IReadOnlyTensor<System.Numerics.Tensors.TensorSpan<T>, T>.AsReadOnlyTensorSpan(params scoped System.ReadOnlySpan<nint> startIndexes) { throw null; }
System.Numerics.Tensors.ReadOnlyTensorSpan<T> System.Numerics.Tensors.IReadOnlyTensor<System.Numerics.Tensors.TensorSpan<T>, T>.AsReadOnlyTensorSpan(params scoped System.ReadOnlySpan<System.Buffers.NIndex> startIndexes) { throw null; }
System.Numerics.Tensors.ReadOnlyTensorSpan<T> System.Numerics.Tensors.IReadOnlyTensor<System.Numerics.Tensors.TensorSpan<T>, T>.AsReadOnlyTensorSpan(params scoped System.ReadOnlySpan<System.Buffers.NRange> ranges) { throw null; }
System.Numerics.Tensors.ReadOnlyTensorDimensionSpan<T> System.Numerics.Tensors.IReadOnlyTensor<System.Numerics.Tensors.TensorSpan<T>, T>.GetDimensionSpan(int dimension) { throw null; }
ref readonly T System.Numerics.Tensors.IReadOnlyTensor<System.Numerics.Tensors.TensorSpan<T>, T>.GetPinnableReference() { throw null; }
System.Numerics.Tensors.TensorSpan<T> System.Numerics.Tensors.IReadOnlyTensor<System.Numerics.Tensors.TensorSpan<T>, T>.ToDenseTensor() { throw null; }

bool System.Numerics.Tensors.ITensor.IsReadOnly { get { throw null; } }
object? System.Numerics.Tensors.ITensor.this[params scoped System.ReadOnlySpan<System.Buffers.NIndex> indexes] { get { throw null; } set { } }
object? System.Numerics.Tensors.ITensor.this[params scoped System.ReadOnlySpan<nint> indexes] { get { throw null; } set { } }
void System.Numerics.Tensors.ITensor.Fill(object value) { }
static System.Numerics.Tensors.TensorSpan<T> ITensor<TensorSpan<T>, T>.Create(scoped System.ReadOnlySpan<nint> lengths, bool pinned) { throw null; }
static System.Numerics.Tensors.TensorSpan<T> ITensor<TensorSpan<T>, T>.Create(scoped System.ReadOnlySpan<nint> lengths, scoped System.ReadOnlySpan<nint> strides, bool pinned) { throw null; }
static System.Numerics.Tensors.TensorSpan<T> ITensor<TensorSpan<T>, T>.CreateUninitialized(scoped System.ReadOnlySpan<nint> lengths, bool pinned) { throw null; }
static System.Numerics.Tensors.TensorSpan<T> ITensor<TensorSpan<T>, T>.CreateUninitialized(scoped System.ReadOnlySpan<nint> lengths, scoped System.ReadOnlySpan<nint> strides, bool pinned) { throw null; }
System.Numerics.Tensors.TensorSpan<T> System.Numerics.Tensors.ITensor<System.Numerics.Tensors.TensorSpan<T>, T>.AsTensorSpan() { throw null; }
System.Numerics.Tensors.TensorSpan<T> System.Numerics.Tensors.ITensor<System.Numerics.Tensors.TensorSpan<T>, T>.AsTensorSpan(params scoped System.ReadOnlySpan<nint> startIndexes) { throw null; }
System.Numerics.Tensors.TensorSpan<T> System.Numerics.Tensors.ITensor<System.Numerics.Tensors.TensorSpan<T>, T>.AsTensorSpan(params scoped System.ReadOnlySpan<System.Buffers.NIndex> startIndexes) { throw null; }
System.Numerics.Tensors.TensorSpan<T> System.Numerics.Tensors.ITensor<System.Numerics.Tensors.TensorSpan<T>, T>.AsTensorSpan(params scoped System.ReadOnlySpan<System.Buffers.NRange> ranges) { throw null; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

namespace System.Buffers
{
[System.Diagnostics.CodeAnalysis.ExperimentalAttribute("SYSLIB5001", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public readonly partial struct NIndex : System.IEquatable<System.Buffers.NIndex>
{
private readonly int _dummyPrimitive;
Expand All @@ -30,7 +29,6 @@ namespace System.Buffers
public System.Index ToIndexUnchecked() { throw null; }
public override string ToString() { throw null; }
}
[System.Diagnostics.CodeAnalysis.ExperimentalAttribute("SYSLIB5001", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public readonly partial struct NRange : System.IEquatable<System.Buffers.NRange>
{
private readonly int _dummyPrimitive;
Expand All @@ -55,7 +53,6 @@ namespace System.Buffers
}
namespace System.Numerics.Tensors
{
[System.Diagnostics.CodeAnalysis.ExperimentalAttribute("SYSLIB5001", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public partial interface IReadOnlyTensor
{
nint FlattenedLength { get; }
Expand All @@ -70,10 +67,12 @@ public partial interface IReadOnlyTensor
int Rank { get; }
[System.Diagnostics.CodeAnalysis.UnscopedRefAttribute]
System.ReadOnlySpan<nint> Strides { get; }
System.Buffers.MemoryHandle GetPinnedHandle();
}
[System.Diagnostics.CodeAnalysis.ExperimentalAttribute("SYSLIB5001", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public partial interface IReadOnlyTensor<TSelf, T> : System.Collections.Generic.IEnumerable<T>, System.Collections.IEnumerable, System.Numerics.Tensors.IReadOnlyTensor where TSelf : System.Numerics.Tensors.IReadOnlyTensor<TSelf, T>
public partial interface IReadOnlyTensor<TSelf, T> : System.Numerics.Tensors.IReadOnlyTensor
where TSelf : System.Numerics.Tensors.IReadOnlyTensor<TSelf, T>
#if NET9_0_OR_GREATER
, allows ref struct
#endif
{
static abstract TSelf Empty { get; }
new ref readonly T this[params scoped System.ReadOnlySpan<System.Buffers.NIndex> indexes] { get; }
Expand All @@ -94,7 +93,6 @@ public partial interface IReadOnlyTensor<TSelf, T> : System.Collections.Generic.
bool TryCopyTo(scoped in System.Numerics.Tensors.TensorSpan<T> destination);
bool TryFlattenTo(scoped System.Span<T> destination);
}
[System.Diagnostics.CodeAnalysis.ExperimentalAttribute("SYSLIB5001", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public partial interface ITensor : System.Numerics.Tensors.IReadOnlyTensor
{
bool IsReadOnly { get; }
Expand All @@ -103,8 +101,11 @@ public partial interface ITensor : System.Numerics.Tensors.IReadOnlyTensor
void Clear();
void Fill(object value);
}
[System.Diagnostics.CodeAnalysis.ExperimentalAttribute("SYSLIB5001", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public partial interface ITensor<TSelf, T> : System.Collections.Generic.IEnumerable<T>, System.Collections.IEnumerable, System.Numerics.Tensors.IReadOnlyTensor, System.Numerics.Tensors.IReadOnlyTensor<TSelf, T>, System.Numerics.Tensors.ITensor where TSelf : System.Numerics.Tensors.ITensor<TSelf, T>
public partial interface ITensor<TSelf, T> : System.Numerics.Tensors.IReadOnlyTensor, System.Numerics.Tensors.IReadOnlyTensor<TSelf, T>, System.Numerics.Tensors.ITensor
where TSelf : System.Numerics.Tensors.ITensor<TSelf, T>
#if NET9_0_OR_GREATER
, allows ref struct
#endif
{
new ref T this[params scoped System.ReadOnlySpan<System.Buffers.NIndex> indexes] { get; }
new TSelf this[params scoped System.ReadOnlySpan<System.Buffers.NRange> ranges] { get; set; }
Expand All @@ -126,6 +127,7 @@ public readonly ref partial struct ReadOnlyTensorDimensionSpan<T>
private readonly object _dummy;
private readonly int _dummyPrimitive;
public System.Numerics.Tensors.ReadOnlyTensorSpan<T> this[nint index] { get { throw null; } }
public bool IsDense { get { throw null; } }
public nint Length { get { throw null; } }
public System.Numerics.Tensors.ReadOnlyTensorDimensionSpan<T>.Enumerator GetEnumerator() { throw null; }
public ref partial struct Enumerator
Expand All @@ -137,7 +139,6 @@ public ref partial struct Enumerator
public void Reset() { }
}
}
[System.Diagnostics.CodeAnalysis.ExperimentalAttribute("SYSLIB5001", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public readonly ref partial struct ReadOnlyTensorSpan<T>
{
private readonly object _dummy;
Expand All @@ -162,6 +163,7 @@ public readonly ref partial struct ReadOnlyTensorSpan<T>
public bool HasAnyDenseDimensions { get { throw null; } }
public bool IsDense { get { throw null; } }
public bool IsEmpty { get { throw null; } }
public bool IsPinned { get { throw null; } }
public ref readonly T this[params scoped System.ReadOnlySpan<System.Buffers.NIndex> indexes] { get { throw null; } }
public System.Numerics.Tensors.ReadOnlyTensorSpan<T> this[params scoped System.ReadOnlySpan<System.Buffers.NRange> ranges] { get { throw null; } }
public ref readonly T this[params scoped System.ReadOnlySpan<nint> indexes] { get { throw null; } }
Expand Down Expand Up @@ -205,10 +207,9 @@ public void FlattenTo(scoped System.Span<T> destination) { }
readonly object? System.Collections.IEnumerator.Current { get { throw null; } }
public bool MoveNext() { throw null; }
public void Reset() { }
void System.IDisposable.Dispose() { }
readonly void System.IDisposable.Dispose() { }
}
}
[System.Diagnostics.CodeAnalysis.ExperimentalAttribute("SYSLIB5001", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public static partial class Tensor
{
public static System.Numerics.Tensors.Tensor<T> Abs<T>(in System.Numerics.Tensors.ReadOnlyTensorSpan<T> x) where T : System.Numerics.INumberBase<T> { throw null; }
Expand Down Expand Up @@ -578,7 +579,9 @@ public readonly ref partial struct TensorDimensionSpan<T>
private readonly object _dummy;
private readonly int _dummyPrimitive;
public System.Numerics.Tensors.TensorSpan<T> this[nint index] { get { throw null; } }
public bool IsDense { get { throw null; } }
public nint Length { get { throw null; } }
public static implicit operator System.Numerics.Tensors.ReadOnlyTensorDimensionSpan<T>(scoped in System.Numerics.Tensors.TensorDimensionSpan<T> tensorDimension) { throw null; }
public System.Numerics.Tensors.TensorDimensionSpan<T>.Enumerator GetEnumerator() { throw null; }
public ref partial struct Enumerator
{
Expand Down Expand Up @@ -823,7 +826,6 @@ public static void Truncate<T>(System.ReadOnlySpan<T> x, System.Span<T> destinat
public static void Xor<T>(System.ReadOnlySpan<T> x, System.ReadOnlySpan<T> y, System.Span<T> destination) where T : System.Numerics.IBitwiseOperators<T, T, T> { }
public static void Xor<T>(System.ReadOnlySpan<T> x, T y, System.Span<T> destination) where T : System.Numerics.IBitwiseOperators<T, T, T> { }
}
[System.Diagnostics.CodeAnalysis.ExperimentalAttribute("SYSLIB5001", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public readonly ref partial struct TensorSpan<T>
{
private readonly object _dummy;
Expand All @@ -848,6 +850,7 @@ public readonly ref partial struct TensorSpan<T>
public bool HasAnyDenseDimensions { get { throw null; } }
public bool IsDense { get { throw null; } }
public bool IsEmpty { get { throw null; } }
public bool IsPinned { get { throw null; } }
public ref T this[params scoped System.ReadOnlySpan<System.Buffers.NIndex> indexes] { get { throw null; } }
public System.Numerics.Tensors.TensorSpan<T> this[params scoped System.ReadOnlySpan<System.Buffers.NRange> ranges] { get { throw null; } set { } }
public ref T this[params scoped System.ReadOnlySpan<nint> indexes] { get { throw null; } }
Expand Down Expand Up @@ -897,11 +900,10 @@ public void FlattenTo(scoped System.Span<T> destination) { }
readonly object? System.Collections.IEnumerator.Current { get { throw null; } }
public bool MoveNext() { throw null; }
public void Reset() { }
void System.IDisposable.Dispose() { }
readonly void System.IDisposable.Dispose() { }
}
}
[System.Diagnostics.CodeAnalysis.ExperimentalAttribute("SYSLIB5001", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public sealed partial class Tensor<T> : System.Collections.Generic.IEnumerable<T>, System.Collections.IEnumerable, System.Numerics.Tensors.IReadOnlyTensor, System.Numerics.Tensors.IReadOnlyTensor<System.Numerics.Tensors.Tensor<T>, T>, System.Numerics.Tensors.ITensor, System.Numerics.Tensors.ITensor<System.Numerics.Tensors.Tensor<T>, T>
public sealed partial class Tensor<T> : System.Collections.IEnumerable, System.Collections.Generic.IEnumerable<T>, System.Numerics.Tensors.IReadOnlyTensor, System.Numerics.Tensors.IReadOnlyTensor<System.Numerics.Tensors.Tensor<T>, T>, System.Numerics.Tensors.ITensor, System.Numerics.Tensors.ITensor<System.Numerics.Tensors.Tensor<T>, T>
{
internal Tensor() { }
public static System.Numerics.Tensors.Tensor<T> Empty { get { throw null; } }
Expand Down
Loading
Loading