6 writes to _shape
System.Numerics.Tensors (6)
System\Numerics\Tensors\netcore\ReadOnlyTensorSpan.cs (6)
105
_shape
= new TensorShape(array.Length - start, lengths, strides);
135
_shape
= new TensorShape(span.Length, lengths, strides);
186
_shape
= new TensorShape(array.Length - startOffset, lengths, strides);
230
_shape
= new TensorShape(array.Length - startOffset, lengths, strides);
284
_shape
= new TensorShape(dataLength, lengths, strides);
294
_shape
= new TensorShape(memoryLength, lengths, strides);
85 references to _shape
System.Numerics.Tensors (85)
System\Numerics\Tensors\netcore\ReadOnlyTensorSpan.cs (25)
315
if (index >=
_shape
._memoryLength || index < 0)
338
if (index >=
_shape
._memoryLength || index < 0)
367
public nint FlattenedLength =>
_shape
.FlattenedLength;
373
public bool IsEmpty =>
_shape
.IsEmpty;
379
public ReadOnlySpan<nint> Lengths =>
_shape
.Lengths;
390
public ReadOnlySpan<nint> Strides =>
_shape
.Strides;
403
left.
_shape
.FlattenedLength == right.
_shape
.FlattenedLength &&
405
left.
_shape
.Lengths.SequenceEqual(right.
_shape
.Lengths )&&
446
return new ReadOnlyTensorSpan<T>(ref Unsafe.As<TDerived, T>(ref items._reference), items.
_shape
.Lengths, items.
_shape
.Strides, items.
_shape
._memoryLength);
504
if (
_shape
.FlattenedLength != 0) ret = ref _reference;
629
public override string ToString() => $"System.Numerics.Tensors.ReadOnlyTensorSpan<{typeof(T).Name}>[{
_shape
.FlattenedLength}]";
715
if ((index >=
_shape
._memoryLength || index < 0) && flattenedLength != 0)
718
toReturn = new ReadOnlyTensorSpan<T>(ref Unsafe.Add(ref _reference, index), lengths,
_shape
.Strides,
_shape
._memoryLength - index);
735
if (destination.Length <
_shape
.FlattenedLength)
752
while (copiedValues <
_shape
.FlattenedLength)
755
TensorSpanHelpers.AdjustIndexes(Rank - 2, 1, curIndexes,
_shape
.Lengths);
772
if (destination.Length <
_shape
.FlattenedLength)
775
if (
_shape
.FlattenedLength == 0)
793
while (copiedValues <
_shape
.FlattenedLength)
803
TensorSpanHelpers.AdjustIndexes(Rank - 2, 1, curIndexes,
_shape
.Lengths);
System\Numerics\Tensors\netcore\TensorExtensions.cs (52)
193
return new TensorSpan<T>(ref input._reference, shape, input.Strides, input.
_shape
._memoryLength);
219
TensorSpan<T> output = new TensorSpan<T>(ref input._reference, shape, strides, input.
_shape
._memoryLength);
796
Span<T> valuesSpan = MemoryMarshal.CreateSpan(ref values._reference, (int)values.
_shape
._memoryLength);
2928
ReadOnlyTensorSpan<T> output = new ReadOnlyTensorSpan<T>(ref tensor._reference, arrLengths, strides, tensor.
_shape
._memoryLength);
2995
ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref tensor._reference, (int)tensor.
_shape
._memoryLength);
2997
if (destination._shape._memoryLength > tensor.
_shape
._memoryLength)
2998
TensorSpanHelpers.Memmove(ospan, span, tensor.
_shape
._memoryLength);
3052
nint index = tensor.
_shape
._memoryLength - 1;
3053
Span<T> inputSpan = MemoryMarshal.CreateSpan(ref tensor._reference, (int)tensor.
_shape
._memoryLength);
3055
for (int i = 0; i <= tensor.
_shape
._memoryLength / 2; i++)
3123
&& tensor._shape._memoryLength == other.
_shape
._memoryLength
3125
&& MemoryMarshal.CreateReadOnlySpan(in tensor.GetPinnableReference(), (int)tensor._shape._memoryLength).SequenceEqual(MemoryMarshal.CreateReadOnlySpan(in other.GetPinnableReference(), (int)other.
_shape
._memoryLength));
3135
&& tensor.
_shape
._memoryLength == other.
_shape
._memoryLength
3137
&& MemoryMarshal.CreateReadOnlySpan(in tensor.GetPinnableReference(), (int)tensor.
_shape
._memoryLength).SequenceEqual(MemoryMarshal.CreateReadOnlySpan(in other.GetPinnableReference(), (int)other.
_shape
._memoryLength));
3429
return new ReadOnlyTensorSpan<T>(ref tensor._reference, lengths, strides, tensor.
_shape
._memoryLength);
3519
Span<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x.
_shape
._memoryLength);
3525
return T.CreateChecked(sum / T.CreateChecked(x.
_shape
._memoryLength));
3726
return new ReadOnlyTensorSpan<T>(ref tensor._reference, lengths, strides, tensor.
_shape
._memoryLength);
5159
ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x.
_shape
._memoryLength);
5170
ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x.
_shape
._memoryLength);
5181
ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x.
_shape
._memoryLength);
5194
ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x.
_shape
._memoryLength);
5960
ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x.
_shape
._memoryLength);
6202
if (destination._shape._memoryLength < x.
_shape
._memoryLength)
6205
ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x.
_shape
._memoryLength);
6233
if (destination._shape._memoryLength < x.
_shape
._memoryLength)
6236
ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x.
_shape
._memoryLength);
6264
if (destination._shape._memoryLength < x.
_shape
._memoryLength)
6267
ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x.
_shape
._memoryLength);
6314
if (destination._shape._memoryLength < x.
_shape
._memoryLength)
6317
ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x.
_shape
._memoryLength);
6341
if (destination._shape._memoryLength < x.
_shape
._memoryLength)
6344
ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x.
_shape
._memoryLength);
6368
if (destination._shape._memoryLength < x.
_shape
._memoryLength)
6371
ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x.
_shape
._memoryLength);
6815
ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref input._reference, (int)input.
_shape
.FlattenedLength);
6835
ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref left._reference, (int)left.
_shape
.FlattenedLength);
6836
ReadOnlySpan<T> rspan = MemoryMarshal.CreateSpan(ref right._reference, (int)right.
_shape
.FlattenedLength);
6865
if (destination._shape._memoryLength < input.
_shape
.FlattenedLength)
6869
TensorSpan<TOut> slicedDestination = destination.Slice(input.
_shape
.Lengths);
6877
inputSpan = MemoryMarshal.CreateSpan(ref input._reference, (int)input.
_shape
.FlattenedLength);
6918
if (destination._shape._memoryLength < input.
_shape
.FlattenedLength)
6922
TensorSpan<T> slicedDestination = destination.Slice(input.
_shape
.Lengths);
6970
if (destination._shape._memoryLength < input.
_shape
.FlattenedLength)
6974
TensorSpan<T> slicedDestination = destination.Slice(input.
_shape
.Lengths);
6981
inputSpan = MemoryMarshal.CreateSpan(ref input._reference, (int)input.
_shape
._memoryLength);
7030
ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref left._reference, left.
_shape
._memoryLength <= left.FlattenedLength ? (int)left.
_shape
._memoryLength : (int)left.FlattenedLength);
7031
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)
22
Span<bool> filterSpan = MemoryMarshal.CreateSpan(ref filter._reference, (int)filter.
_shape
._memoryLength);
92
=> tensor1.
_shape
._memoryLength == tensor2.
_shape
._memoryLength;
106
if (tensor.
_shape
.Strides[^1] != 1)
110
for (int i = tensor.
_shape
._rank - 2; i >= 0; i--)
112
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);