17 writes to _shape
System.Numerics.Tensors (17)
System\Numerics\Tensors\netcore\TensorSpan.cs (17)
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);
179
_shape
= shape;
58 references to _shape
System.Numerics.Tensors (58)
System\Numerics\Tensors\netcore\ReadOnlyTensorSpan_1.cs (1)
444
if (TensorShape.AreCompatible(destination.
_shape
, _shape, false))
System\Numerics\Tensors\netcore\Tensor.cs (13)
462
Span<T> span = MemoryMarshal.CreateSpan<T>(ref destination._reference, (int)destination.
_shape
.LinearLength);
485
Span<T> span = MemoryMarshal.CreateSpan<T>(ref destination._reference, (int)destination.
_shape
.LinearLength);
1576
TensorSpan<T> output = new TensorSpan<T>(ref tensor._reference, tensor.
_shape
.LinearLength, newLengths, strides);
1709
Span<T> ospan = MemoryMarshal.CreateSpan(ref destination._reference, (int)destination.
_shape
.LinearLength);
1804
&& tensor.
_shape
.LinearLength == other._shape.LinearLength
1806
&& MemoryMarshal.CreateReadOnlySpan(in tensor.GetPinnableReference(), (int)tensor.
_shape
.LinearLength).SequenceEqual(MemoryMarshal.CreateReadOnlySpan(in other.GetPinnableReference(), (int)other._shape.LinearLength));
2021
strideOrder[index++] = tensor.
_shape
.LinearRankOrder[i];
2025
removed[removedIndex++] = tensor.
_shape
.LinearRankOrder[i];
2045
strideOrder[index++] = tensor.
_shape
.LinearRankOrder[i];
2049
removed = tensor.
_shape
.LinearRankOrder[i];
2055
TensorSpan<T> output = new TensorSpan<T>(ref tensor._reference, tensor.
_shape
.LinearLength, lengths[..newRank], strides[..newRank], strideOrder[..newRank]);
2419
if (!TensorShape.AreCompatible(destination.
_shape
, tensor._shape, false))
2496
TensorSpan<T> output = new TensorSpan<T>(ref tensor._reference, tensor.
_shape
.LinearLength, newLengths, newStrides);
System\Numerics\Tensors\netcore\TensorOperation.cs (24)
20
linearOffset = x.
_shape
.AdjustToNextIndex(x.
_shape
, linearOffset, indexes);
96
linearOffset = destination.
_shape
.AdjustToNextIndex(destination.
_shape
, linearOffset, indexes);
114
xLinearOffset = x._shape.AdjustToNextIndex(destination.
_shape
, xLinearOffset, xIndexes);
115
destinationLinearOffset = destination.
_shape
.AdjustToNextIndex(destination.
_shape
, destinationLinearOffset, destinationIndexes);
138
nint destinationLinearOffset = destination.
_shape
.LinearLength;
142
xLinearOffset = x._shape.AdjustToNextIndex(destination.
_shape
, xLinearOffset, xIndexes);
143
destinationLinearOffset = destination.
_shape
.AdjustToPreviousIndex(destination.
_shape
, destinationLinearOffset, destinationIndexes);
203
xLinearOffset = x._shape.AdjustToNextIndex(destination.
_shape
, xLinearOffset, xIndexes);
204
yLinearOffset = y._shape.AdjustToNextIndex(destination.
_shape
, yLinearOffset, yIndexes);
205
destinationLinearOffset = destination.
_shape
.AdjustToNextIndex(destination.
_shape
, destinationLinearOffset, destinationIndexes);
263
xLinearOffset = x._shape.AdjustToNextIndex(destination.
_shape
, xLinearOffset, xIndexes);
264
destinationLinearOffset = destination.
_shape
.AdjustToNextIndex(destination.
_shape
, destinationLinearOffset, destinationIndexes);
285
xLinearOffset = y._shape.AdjustToNextIndex(destination.
_shape
, xLinearOffset, xIndexes);
286
destinationLinearOffset = destination.
_shape
.AdjustToNextIndex(destination.
_shape
, destinationLinearOffset, destinationIndexes);
338
if (!TensorShape.AreCompatible(destination.
_shape
, x._shape, false))
347
if (TensorShape.AreCompatible(destination.
_shape
, x._shape, false))
349
if (TensorShape.AreCompatible(destination.
_shape
, y._shape, false))
System\Numerics\Tensors\netcore\TensorSpan.cs (20)
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));
202
public nint FlattenedLength =>
_shape
.FlattenedLength;
205
public bool HasAnyDenseDimensions =>
_shape
.HasAnyDenseDimensions;
208
public bool IsDense =>
_shape
.IsDense;
211
public bool IsEmpty =>
_shape
.IsEmpty;
215
public ReadOnlySpan<nint> Lengths =>
_shape
.Lengths;
222
public ReadOnlySpan<nint> Strides =>
_shape
.Strides;
227
&& left.
_shape
== right.
_shape
;
241
new ReadOnlyTensorSpan<T>(ref tensor._reference, tensor.
_shape
);
244
public ReadOnlyTensorSpan<T> AsReadOnlyTensorSpan() => new ReadOnlyTensorSpan<T>(ref _reference, in
_shape
);
300
if (
_shape
.FlattenedLength != 0) ret = ref _reference;
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);
335
public override string ToString() => $"System.Numerics.Tensors.TensorSpan<{typeof(T).Name}>[{
_shape
}]";
368
if (_itemsEnumerated == _span.
_shape
.FlattenedLength)
373
_linearOffset = _span.
_shape
.AdjustToNextIndex(_span.
_shape
, _linearOffset, _indexes);