@@ -67,9 +67,13 @@ public partial interface IReadOnlyTensor
6767 int Rank { get ; }
6868 [ System . Diagnostics . CodeAnalysis . UnscopedRefAttribute ]
6969 System . ReadOnlySpan < nint > Strides { get ; }
70- System . Buffers . MemoryHandle GetPinnedHandle ( ) ;
7170 }
72- 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 >
71+ public partial interface IReadOnlyTensor < TSelf , T > : System . Numerics . Tensors . IReadOnlyTensor
72+ #if NET9_0_OR_GREATER
73+ where TSelf : System . Numerics . Tensors . IReadOnlyTensor < TSelf , T > , allows ref struct
74+ #else
75+ where TSelf : System . Numerics . Tensors . IReadOnlyTensor < TSelf , T >
76+ #endif
7377 {
7478 static abstract TSelf Empty { get ; }
7579 new ref readonly T this [ params scoped System. ReadOnlySpan < System . Buffers . NIndex > indexes ] { get ; }
@@ -98,7 +102,12 @@ public partial interface ITensor : System.Numerics.Tensors.IReadOnlyTensor
98102 void Clear ( ) ;
99103 void Fill ( object value ) ;
100104 }
101- 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 >
105+ public partial interface ITensor < TSelf , T > : System . Numerics . Tensors . IReadOnlyTensor , System . Numerics . Tensors . IReadOnlyTensor < TSelf , T > , System . Numerics . Tensors . ITensor
106+ #if NET9_0_OR_GREATER
107+ where TSelf : System . Numerics . Tensors . ITensor < TSelf , T > , allows ref struct
108+ #else
109+ where TSelf : System . Numerics . Tensors . ITensor < TSelf , T >
110+ #endif
102111 {
103112 new ref T this [ params scoped System. ReadOnlySpan < System . Buffers . NIndex > indexes ] { get ; }
104113 new TSelf this [ params scoped System. ReadOnlySpan < System . Buffers . NRange > ranges ] { get ; set ; }
@@ -120,6 +129,7 @@ public readonly ref partial struct ReadOnlyTensorDimensionSpan<T>
120129 private readonly object _dummy ;
121130 private readonly int _dummyPrimitive ;
122131 public System . Numerics . Tensors . ReadOnlyTensorSpan < T > this [ nint index ] { get { throw null ; } }
132+ public bool IsDense { get { throw null ; } }
123133 public nint Length { get { throw null ; } }
124134 public System . Numerics . Tensors . ReadOnlyTensorDimensionSpan < T > . Enumerator GetEnumerator ( ) { throw null ; }
125135 public ref partial struct Enumerator
@@ -155,6 +165,7 @@ public readonly ref partial struct ReadOnlyTensorSpan<T>
155165 public bool HasAnyDenseDimensions { get { throw null ; } }
156166 public bool IsDense { get { throw null ; } }
157167 public bool IsEmpty { get { throw null ; } }
168+ public bool IsPinned { get { throw null ; } }
158169 public ref readonly T this [ params scoped System. ReadOnlySpan< System. Buffers. NIndex> indexes] { get { throw null ; } }
159170 public System . Numerics . Tensors . ReadOnlyTensorSpan < T > this [ params scoped System. ReadOnlySpan< System. Buffers. NRange> ranges] { get { throw null ; } }
160171 public ref readonly T this [ params scoped System. ReadOnlySpan< nint > indexes] { get { throw null ; } }
@@ -198,7 +209,7 @@ public void FlattenTo(scoped System.Span<T> destination) { }
198209 readonly object ? System . Collections. IEnumerator. Current { get { throw null ; } }
199210 public bool MoveNext ( ) { throw null ; }
200211 public void Reset ( ) { }
201- void System . IDisposable. Dispose( ) { }
212+ readonly void System . IDisposable. Dispose( ) { }
202213 }
203214 }
204215 public static partial class Tensor
@@ -570,7 +581,9 @@ public readonly ref partial struct TensorDimensionSpan<T>
570581 private readonly object _dummy;
571582 private readonly int _dummyPrimitive ;
572583 public System . Numerics . Tensors . TensorSpan < T > this [ nint index ] { get { throw null ; } }
584+ public bool IsDense { get { throw null ; } }
573585 public nint Length { get { throw null ; } }
586+ public static implicit operator System . Numerics . Tensors . ReadOnlyTensorDimensionSpan < T > ( scoped in System . Numerics . Tensors . TensorDimensionSpan < T > tensorDimension ) { throw null ; }
574587 public System . Numerics . Tensors . TensorDimensionSpan < T > . Enumerator GetEnumerator ( ) { throw null ; }
575588 public ref partial struct Enumerator
576589 {
@@ -839,6 +852,7 @@ public readonly ref partial struct TensorSpan<T>
839852 public bool HasAnyDenseDimensions { get { throw null ; } }
840853 public bool IsDense { get { throw null ; } }
841854 public bool IsEmpty { get { throw null ; } }
855+ public bool IsPinned { get { throw null ; } }
842856 public ref T this [ params scoped System. ReadOnlySpan < System . Buffers . NIndex > indexes ] { get { throw null ; } }
843857 public System . Numerics . Tensors . TensorSpan < T > this [ params scoped System. ReadOnlySpan < System . Buffers . NRange > ranges ] { get { throw null ; } set { } }
844858 public ref T this [ params scoped System. ReadOnlySpan < nint > indexes ] { get { throw null ; } }
@@ -888,10 +902,10 @@ public void FlattenTo(scoped System.Span<T> destination) { }
888902 readonly object ? System . Collections . IEnumerator . Current { get { throw null ; } }
889903 public bool MoveNext ( ) { throw null ; }
890904 public void Reset ( ) { }
891- void System . IDisposable. Dispose( ) { }
905+ readonly void System . IDisposable . Dispose ( ) { }
892906 }
893907 }
894- 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 >
908+ 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 >
895909 {
896910 internal Tensor ( ) { }
897911 public static System . Numerics . Tensors . Tensor < T > Empty { get { throw null ; } }
0 commit comments