6 writes to _shape
System.Numerics.Tensors (6)
System\Numerics\Tensors\netcore\ReadOnlyTensorSpan.cs (6)
104
_shape
= new TensorShape(array.Length - start, lengths, strides);
134
_shape
= new TensorShape(span.Length, lengths, strides);
199
_shape
= new TensorShape(array.Length - startOffset, lengths, strides);
247
_shape
= new TensorShape(array.Length - startOffset, lengths, strides);
301
_shape
= new TensorShape(dataLength, lengths, strides);
311
_shape
= new TensorShape(memoryLength, lengths, strides);
85 references to _shape
System.Numerics.Tensors (85)
System\Numerics\Tensors\netcore\ReadOnlyTensorSpan.cs (25)
332
if (index >=
_shape
._memoryLength || index < 0)
355
if (index >=
_shape
._memoryLength || index < 0)
384
public nint FlattenedLength =>
_shape
.FlattenedLength;
390
public bool IsEmpty =>
_shape
.IsEmpty;
396
public ReadOnlySpan<nint> Lengths =>
_shape
.Lengths;
407
public ReadOnlySpan<nint> Strides =>
_shape
.Strides;
420
left.
_shape
.FlattenedLength == right.
_shape
.FlattenedLength &&
422
left.
_shape
.Lengths.SequenceEqual(right.
_shape
.Lengths )&&
463
return new ReadOnlyTensorSpan<T>(ref Unsafe.As<TDerived, T>(ref items._reference), items.
_shape
.Lengths, items.
_shape
.Strides, items.
_shape
._memoryLength);
521
if (
_shape
.FlattenedLength != 0) ret = ref _reference;
646
public override string ToString() => $"System.Numerics.Tensors.ReadOnlyTensorSpan<{typeof(T).Name}>[{
_shape
.FlattenedLength}]";
732
if ((index >=
_shape
._memoryLength || index < 0) && flattenedLength != 0)
735
toReturn = new ReadOnlyTensorSpan<T>(ref Unsafe.Add(ref _reference, index), lengths,
_shape
.Strides,
_shape
._memoryLength - index);
752
if (destination.Length <
_shape
.FlattenedLength)
769
while (copiedValues <
_shape
.FlattenedLength)
772
TensorSpanHelpers.AdjustIndexes(Rank - 2, 1, curIndexes,
_shape
.Lengths);
789
if (destination.Length <
_shape
.FlattenedLength)
792
if (
_shape
.FlattenedLength == 0)
810
while (copiedValues <
_shape
.FlattenedLength)
820
TensorSpanHelpers.AdjustIndexes(Rank - 2, 1, curIndexes,
_shape
.Lengths);
System\Numerics\Tensors\netcore\TensorExtensions.cs (52)
192
return new TensorSpan<T>(ref input._reference, shape, input.Strides, input.
_shape
._memoryLength);
218
TensorSpan<T> output = new TensorSpan<T>(ref input._reference, shape, strides, input.
_shape
._memoryLength);
795
Span<T> valuesSpan = MemoryMarshal.CreateSpan(ref values._reference, (int)values.
_shape
._memoryLength);
2927
ReadOnlyTensorSpan<T> output = new ReadOnlyTensorSpan<T>(ref tensor._reference, arrLengths, strides, tensor.
_shape
._memoryLength);
2994
ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref tensor._reference, (int)tensor.
_shape
._memoryLength);
2996
if (destination._shape._memoryLength > tensor.
_shape
._memoryLength)
2997
TensorSpanHelpers.Memmove(ospan, span, tensor.
_shape
._memoryLength);
3051
nint index = tensor.
_shape
._memoryLength - 1;
3052
Span<T> inputSpan = MemoryMarshal.CreateSpan(ref tensor._reference, (int)tensor.
_shape
._memoryLength);
3054
for (int i = 0; i <= tensor.
_shape
._memoryLength / 2; i++)
3122
&& tensor._shape._memoryLength == other.
_shape
._memoryLength
3124
&& MemoryMarshal.CreateReadOnlySpan(in tensor.GetPinnableReference(), (int)tensor._shape._memoryLength).SequenceEqual(MemoryMarshal.CreateReadOnlySpan(in other.GetPinnableReference(), (int)other.
_shape
._memoryLength));
3134
&& tensor.
_shape
._memoryLength == other.
_shape
._memoryLength
3136
&& MemoryMarshal.CreateReadOnlySpan(in tensor.GetPinnableReference(), (int)tensor.
_shape
._memoryLength).SequenceEqual(MemoryMarshal.CreateReadOnlySpan(in other.GetPinnableReference(), (int)other.
_shape
._memoryLength));
3428
return new ReadOnlyTensorSpan<T>(ref tensor._reference, lengths, strides, tensor.
_shape
._memoryLength);
3518
Span<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x.
_shape
._memoryLength);
3524
T variance = sum / T.CreateChecked(x.
_shape
._memoryLength);
3782
return new ReadOnlyTensorSpan<T>(ref tensor._reference, lengths, strides, tensor.
_shape
._memoryLength);
5215
ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x.
_shape
._memoryLength);
5226
ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x.
_shape
._memoryLength);
5237
ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x.
_shape
._memoryLength);
5250
ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x.
_shape
._memoryLength);
6016
ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x.
_shape
._memoryLength);
6258
if (destination._shape._memoryLength < x.
_shape
._memoryLength)
6261
ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x.
_shape
._memoryLength);
6289
if (destination._shape._memoryLength < x.
_shape
._memoryLength)
6292
ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x.
_shape
._memoryLength);
6320
if (destination._shape._memoryLength < x.
_shape
._memoryLength)
6323
ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x.
_shape
._memoryLength);
6370
if (destination._shape._memoryLength < x.
_shape
._memoryLength)
6373
ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x.
_shape
._memoryLength);
6397
if (destination._shape._memoryLength < x.
_shape
._memoryLength)
6400
ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x.
_shape
._memoryLength);
6424
if (destination._shape._memoryLength < x.
_shape
._memoryLength)
6427
ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x.
_shape
._memoryLength);
6871
ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref input._reference, (int)input.
_shape
.FlattenedLength);
6891
ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref left._reference, (int)left.
_shape
.FlattenedLength);
6892
ReadOnlySpan<T> rspan = MemoryMarshal.CreateSpan(ref right._reference, (int)right.
_shape
.FlattenedLength);
6921
if (destination._shape._memoryLength < input.
_shape
.FlattenedLength)
6925
TensorSpan<TOut> slicedDestination = destination.Slice(input.
_shape
.Lengths);
6933
inputSpan = MemoryMarshal.CreateSpan(ref input._reference, (int)input.
_shape
.FlattenedLength);
6974
if (destination._shape._memoryLength < input.
_shape
.FlattenedLength)
6978
TensorSpan<T> slicedDestination = destination.Slice(input.
_shape
.Lengths);
7026
if (destination._shape._memoryLength < input.
_shape
.FlattenedLength)
7030
TensorSpan<T> slicedDestination = destination.Slice(input.
_shape
.Lengths);
7037
inputSpan = MemoryMarshal.CreateSpan(ref input._reference, (int)input.
_shape
._memoryLength);
7086
ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref left._reference, left.
_shape
._memoryLength <= left.FlattenedLength ? (int)left.
_shape
._memoryLength : (int)left.FlattenedLength);
7087
ReadOnlySpan<T> rspan = MemoryMarshal.CreateSpan(ref right._reference, right.
_shape
._memoryLength <= right.FlattenedLength ? (int)right.
_shape
._memoryLength : (int)right.FlattenedLength);
System\Numerics\Tensors\netcore\TensorHelpers.cs (6)
20
Span<bool> filterSpan = MemoryMarshal.CreateSpan(ref filter._reference, (int)filter.
_shape
._memoryLength);
90
=> tensor1.
_shape
._memoryLength == tensor2.
_shape
._memoryLength;
104
if (tensor.
_shape
.Strides[^1] != 1)
108
for (int i = tensor.
_shape
._rank - 2; i >= 0; i--)
110
if (tensor.
_shape
.Strides[i] != TensorPrimitives.Product(tensor.Lengths.Slice(i + 1, tensor.Lengths.Length - i - 1)))
System\Numerics\Tensors\netcore\TensorSpanHelpers.cs (2)
16
where T : IEquatable<T>, IEqualityOperators<T, T, bool> => tensor1.
_shape
.Lengths.SequenceEqual(tensor2.
_shape
.Lengths);