15 writes to _shape
System.Numerics.Tensors (15)
System\Numerics\Tensors\netcore\ReadOnlyTensorSpan_1.cs (11)
43
_shape
= TensorShape.Create(array);
78
_shape
= TensorShape.Create(array, lengths, strides);
102
_shape
= TensorShape.Create(array, start, lengths, strides);
114
_shape
= TensorShape.Create(ref reference, span.Length, pinned: false);
144
_shape
= TensorShape.Create(ref reference, span.Length, lengths, strides, pinned: false);
156
_shape
= TensorShape.Create(array);
183
_shape
= TensorShape.Create(array, start, lengths, strides, out nint linearOffset);
198
_shape
= TensorShape.Create(data, dataLength);
237
_shape
= TensorShape.Create(data, dataLength, lengths, strides);
243
_shape
= TensorShape.Create(in data, dataLength, lengths, strides, pinned);
250
_shape
= shape;
System\Numerics\Tensors\netcore\TensorOperation.cs (4)
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
);
74 references to _shape
System.Numerics.Tensors (74)
System\Numerics\Tensors\netcore\ReadOnlyTensorDimensionSpan_1.cs (1)
54
nint linearOffset = _tensor.
_shape
.GetLinearOffsetForDimension(index, _dimension);
System\Numerics\Tensors\netcore\ReadOnlyTensorSpan_1.cs (24)
256
get => ref Unsafe.Add(ref _reference,
_shape
.GetLinearOffset<TensorShape.GetOffsetAndLengthForNInt, nint>(indexes));
262
get => ref Unsafe.Add(ref _reference,
_shape
.GetLinearOffset<TensorShape.GetOffsetAndLengthForNIndex, NIndex>(indexes));
272
public nint FlattenedLength =>
_shape
.FlattenedLength;
275
public bool HasAnyDenseDimensions =>
_shape
.HasAnyDenseDimensions;
278
public bool IsDense =>
_shape
.IsDense;
281
public bool IsEmpty =>
_shape
.IsEmpty;
284
public bool IsPinned =>
_shape
.IsPinned;
288
public ReadOnlySpan<nint> Lengths =>
_shape
.Lengths;
295
public ReadOnlySpan<nint> Strides =>
_shape
.Strides;
304
&& left.
_shape
== right.
_shape
;
328
items.
_shape
381
if (
_shape
.FlattenedLength != 0) ret = ref _reference;
408
TensorShape shape =
_shape
.Slice<TensorShape.GetOffsetAndLengthForNInt, nint>(startIndexes, out nint linearOffset);
418
TensorShape shape =
_shape
.Slice<TensorShape.GetOffsetAndLengthForNIndex, NIndex>(startIndexes, out nint linearOffset);
428
TensorShape shape =
_shape
.Slice<TensorShape.GetOffsetAndLengthForNRange, NRange>(ranges, out nint linearOffset);
437
public override string ToString() => $"System.Numerics.Tensors.ReadOnlyTensorSpan<{typeof(T).Name}>[{
_shape
}]";
442
if (TensorShape.AreCompatible(destination._shape,
_shape
, false))
453
if (
_shape
.FlattenedLength <= destination.Length)
465
nint longestContiguousLength =
_shape
.GetLongestContiguousLength<TensorShape.GetOffsetAndLengthForNInt, nint>(startIndexes, out nint linearOffset);
481
nint longestContiguousLength =
_shape
.GetLongestContiguousLength<TensorShape.GetOffsetAndLengthForNIndex, NIndex>(startIndexes, out nint linearOffset);
554
if (_itemsEnumerated == _span.
_shape
.FlattenedLength)
559
_linearOffset = _span.
_shape
.AdjustToNextIndex(_span.
_shape
, _linearOffset, _indexes);
System\Numerics\Tensors\netcore\Tensor.cs (15)
1535
ReadOnlyTensorSpan<T> output = new ReadOnlyTensorSpan<T>(ref tensor._reference, tensor.
_shape
.LinearLength, newLengths, strides, tensor.IsPinned);
1592
ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref tensor._reference, (int)tensor.
_shape
.LinearLength);
1688
&& tensor._shape.LinearLength == other.
_shape
.LinearLength
1690
&& MemoryMarshal.CreateReadOnlySpan(in tensor.GetPinnableReference(), (int)tensor._shape.LinearLength).SequenceEqual(MemoryMarshal.CreateReadOnlySpan(in other.GetPinnableReference(), (int)other.
_shape
.LinearLength));
1700
&& tensor.
_shape
.LinearLength == other.
_shape
.LinearLength
1702
&& MemoryMarshal.CreateReadOnlySpan(in tensor.GetPinnableReference(), (int)tensor.
_shape
.LinearLength).SequenceEqual(MemoryMarshal.CreateReadOnlySpan(in other.GetPinnableReference(), (int)other.
_shape
.LinearLength));
1977
ReadOnlyTensorSpan<T> output = new ReadOnlyTensorSpan<T>(ref tensor._reference, tensor.
_shape
.LinearLength, lengths[..rank], strides[..rank], tensor.IsPinned);
2226
if (!TensorShape.AreCompatible(destination._shape, tensor.
_shape
, false))
2340
ReadOnlyTensorSpan<T> output = new ReadOnlyTensorSpan<T>(ref tensor._reference, tensor.
_shape
.LinearLength, newLengths, newStrides, tensor.IsPinned);
3735
ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x.
_shape
.LinearLength);
3747
ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x.
_shape
.LinearLength);
3758
ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x.
_shape
.LinearLength);
3771
ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x.
_shape
.LinearLength);
System\Numerics\Tensors\netcore\TensorOperation.cs (34)
34
ref readonly TensorShape destinationShape = ref ((x.
_shape
.FlattenedLength > y.
_shape
.FlattenedLength) ? ref x._shape : ref y._shape);
40
xLinearOffset = x.
_shape
.AdjustToNextIndex(destinationShape, xLinearOffset, xIndexes);
41
yLinearOffset = y.
_shape
.AdjustToNextIndex(destinationShape, yLinearOffset, yIndexes);
70
xLinearOffset = x.
_shape
.AdjustToNextIndex(x.
_shape
, xLinearOffset, xIndexes);
114
xLinearOffset = x.
_shape
.AdjustToNextIndex(destination._shape, xLinearOffset, xIndexes);
142
xLinearOffset = x.
_shape
.AdjustToNextIndex(destination._shape, xLinearOffset, xIndexes);
164
xLinearOffset = x.
_shape
.AdjustToNextIndex(x.
_shape
, xLinearOffset, xIndexes);
183
xLinearOffset = x.
_shape
.AdjustToNextIndex(x.
_shape
, xLinearOffset, xIndexes);
203
xLinearOffset = x.
_shape
.AdjustToNextIndex(destination._shape, xLinearOffset, xIndexes);
204
yLinearOffset = y.
_shape
.AdjustToNextIndex(destination._shape, yLinearOffset, yIndexes);
226
ref readonly TensorShape destinationShape = ref ((x.
_shape
.FlattenedLength > y.
_shape
.FlattenedLength) ? ref x._shape : ref y._shape);
233
xLinearOffset = x.
_shape
.AdjustToNextIndex(destinationShape, xLinearOffset, xIndexes);
234
yLinearOffset = y.
_shape
.AdjustToNextIndex(destinationShape, yLinearOffset, yIndexes);
263
xLinearOffset = x.
_shape
.AdjustToNextIndex(destination._shape, xLinearOffset, xIndexes);
285
xLinearOffset = y.
_shape
.AdjustToNextIndex(destination._shape, xLinearOffset, xIndexes);
306
xLinearOffset = x.
_shape
.AdjustToNextIndex(x.
_shape
, xLinearOffset, xIndexes);
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))
366
destination = Tensor.CreateFromShapeUninitialized<TResult>(x.
_shape
.Lengths);
370
destination = Tensor.CreateFromShapeUninitialized<TResult>(y.
_shape
.Lengths);