12 instantiations of TensorShape
System.Numerics.Tensors (12)
System\Numerics\Tensors\netcore\TensorShape.cs (12)
782
TensorShape result = new
TensorShape
(
881
TensorShape result = new
TensorShape
(linearLength - computedOffset, lengths, strides, linearRankOrder: []);
904
=> new
TensorShape
(linearLength: -1, lengths, strides: [], linearRankOrder: []);
907
=> new
TensorShape
(linearLength: -1, lengths, strides, linearRankOrder: []);
915
return new
TensorShape
(
933
return new
TensorShape
(linearLength, lengths, strides: [], linearRankOrder: []);
948
return new
TensorShape
(linearLength, lengths, strides, linearRankOrder: []);
970
return new
TensorShape
(linearLength, lengths, strides, linearRankOrder: []);
996
return new
TensorShape
(linearLength, lengths, strides, linearRankOrder);
1014
return new
TensorShape
(
1041
return new
TensorShape
(linearLength, lengths, strides, linearRankOrder);
1235
TensorShape result = new
TensorShape
(
125 references to TensorShape
System.Numerics.Tensors (125)
System\Numerics\Tensors\netcore\ReadOnlyTensorSpan_1.cs (27)
29
internal readonly
TensorShape
_shape;
40
_shape =
TensorShape
.Create(array);
58
_shape =
TensorShape
.Create(array, lengths);
80
_shape =
TensorShape
.Create(array, lengths, strides);
104
_shape =
TensorShape
.Create(array, start, lengths, strides);
116
_shape =
TensorShape
.Create(ref reference, span.Length);
131
_shape =
TensorShape
.Create(ref reference, span.Length, lengths);
150
_shape =
TensorShape
.Create(ref reference, span.Length, lengths, strides);
162
_shape =
TensorShape
.Create(array);
189
_shape =
TensorShape
.Create(array, start, lengths, strides, out nint linearOffset);
204
_shape =
TensorShape
.Create(data, dataLength);
223
_shape =
TensorShape
.Create(data, dataLength, lengths);
246
_shape =
TensorShape
.Create(data, dataLength, lengths, strides);
253
_shape =
TensorShape
.Create(ref data, dataLength);
259
_shape =
TensorShape
.Create(ref data, dataLength, lengths);
265
_shape =
TensorShape
.Create(ref data, dataLength, lengths, strides);
271
_shape =
TensorShape
.Create(ref data, dataLength, lengths, strides, linearRankOrder);
275
internal ReadOnlyTensorSpan(ref T reference, scoped in
TensorShape
shape)
284
get => ref Unsafe.Add(ref _reference, _shape.GetLinearOffset<
TensorShape
.GetOffsetAndLengthForNInt, nint>(indexes));
290
get => ref Unsafe.Add(ref _reference, _shape.GetLinearOffset<
TensorShape
.GetOffsetAndLengthForNIndex, NIndex>(indexes));
410
TensorShape
shape = _shape.Slice<
TensorShape
.GetOffsetAndLengthForNInt, nint>(startIndexes, out nint linearOffset);
420
TensorShape
shape = _shape.Slice<
TensorShape
.GetOffsetAndLengthForNIndex, NIndex>(startIndexes, out nint linearOffset);
430
TensorShape
shape = _shape.Slice<
TensorShape
.GetOffsetAndLengthForNRange, NRange>(ranges, out nint linearOffset);
444
if (
TensorShape
.AreCompatible(destination._shape, _shape, false))
System\Numerics\Tensors\netcore\Tensor.cs (8)
241
if (!
TensorShape
.AreLengthsTheSame(destination.Lengths, lengths))
437
TensorShape
shape =
TensorShape
.Create(lengths, strides: []);
445
TensorShape
shape =
TensorShape
.Create(lengths, strides);
2299
TensorShape
tmpShape =
TensorShape
.Create(tensor.Lengths[1..], tensor.Strides[1..]);
2419
if (!
TensorShape
.AreCompatible(destination._shape, tensor._shape, false))
System\Numerics\Tensors\netcore\Tensor_1.cs (18)
25
internal readonly
TensorShape
_shape;
33
_shape =
TensorShape
.Create(lengths);
42
_shape =
TensorShape
.Create(lengths, strides);
51
_shape =
TensorShape
.Create(array);
60
_shape =
TensorShape
.Create(array, lengths);
69
_shape =
TensorShape
.Create(array, lengths, strides);
78
_shape =
TensorShape
.Create(array, start, lengths, strides);
87
_shape =
TensorShape
.Create(array, start, lengths, strides, linearRankOrder);
94
internal Tensor(T[] array, in
TensorShape
shape, bool isPinned)
105
internal Tensor(T[] array, int start, in
TensorShape
shape, bool isPinned)
128
get => ref Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(_values), _start + _shape.GetLinearOffset<
TensorShape
.GetOffsetAndLengthForNInt, nint>(indexes));
134
get => ref Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(_values), _start + _shape.GetLinearOffset<
TensorShape
.GetOffsetAndLengthForNIndex, NIndex>(indexes));
252
TensorShape
shape = _shape.Slice<
TensorShape
.GetOffsetAndLengthForNInt, nint>(startIndexes, out nint linearOffset);
268
TensorShape
shape = _shape.Slice<
TensorShape
.GetOffsetAndLengthForNIndex, NIndex>(startIndexes, out nint linearOffset);
284
TensorShape
shape = _shape.Slice<
TensorShape
.GetOffsetAndLengthForNRange, NRange>(ranges, out nint linearOffset);
System\Numerics\Tensors\netcore\TensorOperation.cs (11)
34
ref readonly
TensorShape
destinationShape = ref ((x._shape.FlattenedLength > y._shape.FlattenedLength) ? ref x._shape : ref y._shape);
226
ref readonly
TensorShape
destinationShape = ref ((x._shape.FlattenedLength > y._shape.FlattenedLength) ? ref x._shape : ref y._shape);
324
if (!
TensorShape
.AreCompatible(lengths, x._shape))
331
if (!
TensorShape
.AreCompatible(x._shape, y._shape, true))
338
if (!
TensorShape
.AreCompatible(destination._shape, x._shape, false))
345
if (
TensorShape
.AreCompatible(x._shape, y._shape, true))
347
if (
TensorShape
.AreCompatible(destination._shape, x._shape, false))
349
if (
TensorShape
.AreCompatible(destination._shape, y._shape, false))
362
if (
TensorShape
.AreCompatible(x._shape, y._shape, true))
2634
private
TensorShape
.InlineBuffer<T> _inline;
2638
if (rank >
TensorShape
.MaxInlineRank)
System\Numerics\Tensors\netcore\TensorShape.cs (35)
48
internal readonly struct TensorShape : IEquatable<
TensorShape
>
434
public static bool operator ==(in
TensorShape
left, in
TensorShape
right)
485
public static bool operator !=(in
TensorShape
left, in
TensorShape
right) => !(left == right);
487
public nint AdjustToNextIndex(in
TensorShape
destinationShape, nint linearOffset, Span<nint> indexes)
552
public nint AdjustToPreviousIndex(in
TensorShape
destinationShape, nint linearOffset, Span<nint> indexes)
618
public static bool AreCompatible(in
TensorShape
shape1, in
TensorShape
shape2, bool allowBidirectional)
629
ref readonly
TensorShape
tmpShape = ref shape1;
699
public static bool AreCompatible(in ReadOnlySpan<nint> shape1Lengths, in
TensorShape
shape2)
745
public static bool AreLengthsTheSame(in
TensorShape
shape1, in
TensorShape
shape2)
755
public static
TensorShape
Create(Array? array)
782
TensorShape
result = new TensorShape(
798
public static
TensorShape
Create(Array? array, scoped ReadOnlySpan<int> start, scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides, out nint linearOffset)
881
TensorShape
result = new TensorShape(linearLength - computedOffset, lengths, strides, linearRankOrder: []);
903
public static
TensorShape
Create(scoped ReadOnlySpan<nint> lengths)
906
public static
TensorShape
Create(scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides)
909
public static
TensorShape
Create<T>(T[]? array)
928
public static
TensorShape
Create<T>(T[]? array, scoped ReadOnlySpan<nint> lengths)
943
public static
TensorShape
Create<T>(T[]? array, scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides)
958
public static
TensorShape
Create<T>(T[]? array, int start, scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides)
984
public static
TensorShape
Create<T>(T[]? array, int start, scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides, scoped ReadOnlySpan<int> linearRankOrder)
1010
public static
TensorShape
Create<T>(ref T reference, nint linearLength)
1031
public static
TensorShape
Create<T>(ref T reference, nint linearLength, scoped ReadOnlySpan<nint> lengths)
1034
public static
TensorShape
Create<T>(ref T reference, nint linearLength, scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides)
1037
public static
TensorShape
Create<T>(ref T reference, nint linearLength, scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides, scoped ReadOnlySpan<int> linearRankOrder)
1055
public static unsafe
TensorShape
Create<T>(T* address, nint linearLength)
1058
public static unsafe
TensorShape
Create<T>(T* address, nint linearLength, scoped ReadOnlySpan<nint> lengths)
1061
public static unsafe
TensorShape
Create<T>(T* address, nint linearLength, scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides)
1065
=> (obj is
TensorShape
other) && (this == other);
1067
public bool Equals(
TensorShape
other) => (this == other);
1117
public
TensorShape
Slice<TGetOffsetAndLength, T>(ReadOnlySpan<T> state, out nint linearOffset)
1235
TensorShape
result = new TensorShape(
System\Numerics\Tensors\netcore\TensorSpan.cs (26)
29
internal readonly
TensorShape
_shape;
38
_shape =
TensorShape
.Create(array);
50
_shape =
TensorShape
.Create(array, lengths);
62
_shape =
TensorShape
.Create(array, lengths, strides);
74
_shape =
TensorShape
.Create(array, start, lengths, strides);
84
_shape =
TensorShape
.Create(ref reference, span.Length);
92
_shape =
TensorShape
.Create(ref reference, span.Length, lengths);
100
_shape =
TensorShape
.Create(ref reference, span.Length, lengths, strides);
110
_shape =
TensorShape
.Create(array);
122
_shape =
TensorShape
.Create(array, start, lengths, strides, out nint linearOffset);
132
_shape =
TensorShape
.Create(data, dataLength);
140
_shape =
TensorShape
.Create(data, dataLength, lengths);
148
_shape =
TensorShape
.Create(data, dataLength, lengths, strides);
154
_shape =
TensorShape
.Create(ref data, dataLength);
160
_shape =
TensorShape
.Create(ref data, dataLength, lengths);
166
_shape =
TensorShape
.Create(ref data, dataLength, lengths, strides);
172
_shape =
TensorShape
.Create(ref data, dataLength, lengths, strides, linearRankOrder);
176
internal TensorSpan(ref T reference, scoped in
TensorShape
shape)
185
get => ref Unsafe.Add(ref _reference, _shape.GetLinearOffset<
TensorShape
.GetOffsetAndLengthForNInt, nint>(indexes));
191
get => ref Unsafe.Add(ref _reference, _shape.GetLinearOffset<
TensorShape
.GetOffsetAndLengthForNIndex, NIndex>(indexes));
307
TensorShape
shape = _shape.Slice<
TensorShape
.GetOffsetAndLengthForNInt, nint>(startIndexes, out nint linearOffset);
317
TensorShape
shape = _shape.Slice<
TensorShape
.GetOffsetAndLengthForNIndex, NIndex>(startIndexes, out nint linearOffset);
327
TensorShape
shape = _shape.Slice<
TensorShape
.GetOffsetAndLengthForNRange, NRange>(ranges, out nint linearOffset);