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);
83 references to _shape
System.Numerics.Tensors (83)
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 (50)
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);
3771
return new ReadOnlyTensorSpan<T>(ref tensor._reference, lengths, strides, tensor.
_shape
._memoryLength);
5204
ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x.
_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);
5239
ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x.
_shape
._memoryLength);
6005
ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x.
_shape
._memoryLength);
6247
if (destination._shape._memoryLength < x.
_shape
._memoryLength)
6250
ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x.
_shape
._memoryLength);
6278
if (destination._shape._memoryLength < x.
_shape
._memoryLength)
6281
ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x.
_shape
._memoryLength);
6309
if (destination._shape._memoryLength < x.
_shape
._memoryLength)
6312
ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x.
_shape
._memoryLength);
6359
if (destination._shape._memoryLength < x.
_shape
._memoryLength)
6362
ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x.
_shape
._memoryLength);
6386
if (destination._shape._memoryLength < x.
_shape
._memoryLength)
6389
ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x.
_shape
._memoryLength);
6413
if (destination._shape._memoryLength < x.
_shape
._memoryLength)
6416
ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x.
_shape
._memoryLength);
6873
ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref input._reference, (int)input.
_shape
.FlattenedLength);
6893
ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref left._reference, (int)left.
_shape
.FlattenedLength);
6894
ReadOnlySpan<T> rspan = MemoryMarshal.CreateSpan(ref right._reference, (int)right.
_shape
.FlattenedLength);
6923
if (destination._shape._memoryLength < input.
_shape
.FlattenedLength)
6927
TensorSpan<TOut> slicedDestination = destination.Slice(input.
_shape
.Lengths);
6935
inputSpan = MemoryMarshal.CreateSpan(ref input._reference, (int)input.
_shape
.FlattenedLength);
6976
if (destination._shape._memoryLength < input.
_shape
.FlattenedLength)
6980
TensorSpan<T> slicedDestination = destination.Slice(input.
_shape
.Lengths);
7028
if (destination._shape._memoryLength < input.
_shape
.FlattenedLength)
7032
TensorSpan<T> slicedDestination = destination.Slice(input.
_shape
.Lengths);
7039
inputSpan = MemoryMarshal.CreateSpan(ref input._reference, (int)input.
_shape
._memoryLength);
7088
ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref left._reference, left.
_shape
._memoryLength <= left.FlattenedLength ? (int)left.
_shape
._memoryLength : (int)left.FlattenedLength);
7089
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);