6 writes to _shape
System.Numerics.Tensors (6)
System\Numerics\Tensors\netcore\TensorSpan.cs (6)
106
_shape
= new TensorShape(array.Length - start, lengths, strides);
137
_shape
= new TensorShape(span.Length, lengths, strides);
201
_shape
= new TensorShape(array.Length - startOffset, lengths, strides);
248
_shape
= new TensorShape(array.Length, lengths, strides);
303
_shape
= new TensorShape(dataLength, lengths, strides);
313
_shape
= new TensorShape(memoryLength, lengths, strides);
75 references to _shape
System.Numerics.Tensors (75)
System\Numerics\Tensors\netcore\Tensor.Factory.cs (3)
191
Span<T> span = MemoryMarshal.CreateSpan<T>(ref destination._reference, (int)destination.
_shape
._memoryLength);
193
GaussianDistribution<T>(span, destination.
_shape
._memoryLength, random ?? Random.Shared);
208
Span<T> span = MemoryMarshal.CreateSpan<T>(ref destination._reference, (int)destination.
_shape
._memoryLength);
System\Numerics\Tensors\netcore\TensorExtensions.cs (44)
135
return new TensorSpan<T>(ref input._reference, shape, input.Strides, input.
_shape
._memoryLength);
161
TensorSpan<T> output = new TensorSpan<T>(ref input._reference, shape, strides, input.
_shape
._memoryLength);
751
Span<T> srcSpan = MemoryMarshal.CreateSpan(ref tensor._reference, (int)tensor.
_shape
._memoryLength);
752
Span<bool> filterSpan = MemoryMarshal.CreateSpan(ref filter._reference, (int)tensor.
_shape
._memoryLength);
779
Span<T> dstSpan = MemoryMarshal.CreateSpan(ref tensor._reference, (int)tensor.
_shape
._memoryLength);
780
Span<bool> filterSpan = MemoryMarshal.CreateSpan(ref filter._reference, (int)tensor.
_shape
._memoryLength);
2844
TensorSpan<T> output = new TensorSpan<T>(ref tensor._reference, arrLengths, strides, tensor.
_shape
._memoryLength);
2949
Span<T> ospan = MemoryMarshal.CreateSpan(ref destination._reference, (int)destination.
_shape
._memoryLength);
2950
if (destination.
_shape
._memoryLength > tensor._values.Length)
2953
TensorSpanHelpers.Memmove(ospan, span, destination.
_shape
._memoryLength);
2964
ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref tensor._reference, (int)tensor.
_shape
._memoryLength);
2965
Span<T> ospan = MemoryMarshal.CreateSpan(ref destination._reference, (int)destination.
_shape
._memoryLength);
2966
if (destination.
_shape
._memoryLength > tensor.
_shape
._memoryLength)
2967
TensorSpanHelpers.Memmove(ospan, span, tensor.
_shape
._memoryLength);
2969
TensorSpanHelpers.Memmove(ospan, span, destination.
_shape
._memoryLength);
2981
Span<T> ospan = MemoryMarshal.CreateSpan(ref destination._reference, (int)destination.
_shape
._memoryLength);
2982
if (destination.
_shape
._memoryLength > tensor._shape._memoryLength)
2985
TensorSpanHelpers.Memmove(ospan, span, destination.
_shape
._memoryLength);
3039
Span<T> outputSpan = MemoryMarshal.CreateSpan(ref destination._reference, (int)destination.
_shape
._memoryLength);
3108
&& tensor.
_shape
._memoryLength == other._shape._memoryLength
3110
&& MemoryMarshal.CreateReadOnlySpan(in tensor.GetPinnableReference(), (int)tensor.
_shape
._memoryLength).SequenceEqual(MemoryMarshal.CreateReadOnlySpan(in other.GetPinnableReference(), (int)other._shape._memoryLength));
3358
return new TensorSpan<T>(ref tensor._reference, lengths, strides, tensor.
_shape
._memoryLength);
3701
return new TensorSpan<T>(ref tensor._reference, lengths, strides, tensor.
_shape
._memoryLength);
4674
Span<T> values = MemoryMarshal.CreateSpan(ref destination._reference, (int)destination.
_shape
._memoryLength);
5986
Span<T> ospan = MemoryMarshal.CreateSpan(ref destination._reference, (int)destination.
_shape
._memoryLength);
6227
if (destination.
_shape
._memoryLength < x._shape._memoryLength)
6231
Span<T> ospan = MemoryMarshal.CreateSpan(ref destination._reference, (int)destination.
_shape
._memoryLength);
6258
if (destination.
_shape
._memoryLength < x._shape._memoryLength)
6262
Span<T> ospan = MemoryMarshal.CreateSpan(ref destination._reference, (int)destination.
_shape
._memoryLength);
6289
if (destination.
_shape
._memoryLength < x._shape._memoryLength)
6293
Span<T> ospan = MemoryMarshal.CreateSpan(ref destination._reference, (int)destination.
_shape
._memoryLength);
6339
if (destination.
_shape
._memoryLength < x._shape._memoryLength)
6343
Span<T> ospan = MemoryMarshal.CreateSpan(ref destination._reference, (int)destination.
_shape
._memoryLength);
6366
if (destination.
_shape
._memoryLength < x._shape._memoryLength)
6370
Span<T> ospan = MemoryMarshal.CreateSpan(ref destination._reference, (int)destination.
_shape
._memoryLength);
6393
if (destination.
_shape
._memoryLength < x._shape._memoryLength)
6397
Span<T> ospan = MemoryMarshal.CreateSpan(ref destination._reference, (int)destination.
_shape
._memoryLength);
6916
if (destination.
_shape
._memoryLength < input._shape.FlattenedLength)
6929
destinationSpan = MemoryMarshal.CreateSpan(ref slicedDestination._reference, (int)slicedDestination.
_shape
.FlattenedLength);
6969
if (destination.
_shape
._memoryLength < input._shape.FlattenedLength)
7021
if (destination.
_shape
._memoryLength < input._shape.FlattenedLength)
7033
destinationSpan = MemoryMarshal.CreateSpan(ref destination._reference, (int)destination.
_shape
._memoryLength);
7083
Span<T> ospan = MemoryMarshal.CreateSpan(ref slicedDestination._reference, (int)slicedDestination.
_shape
._memoryLength);
System\Numerics\Tensors\netcore\TensorSpan.cs (28)
334
if (index >=
_shape
._memoryLength || index < 0)
359
if (index >=
_shape
._memoryLength || index < 0)
390
public nint FlattenedLength =>
_shape
.FlattenedLength;
396
public bool IsEmpty =>
_shape
.IsEmpty;
402
public ReadOnlySpan<nint> Lengths =>
_shape
.Lengths;
413
public ReadOnlySpan<nint> Strides =>
_shape
.Strides;
426
left.
_shape
.FlattenedLength == right.
_shape
.FlattenedLength &&
428
left.
_shape
.Lengths.SequenceEqual(right.
_shape
.Lengths) &&
429
left.
_shape
.Strides.SequenceEqual(right.
_shape
.Strides) &&
513
if (
_shape
.FlattenedLength != 0) ret = ref _reference;
538
while (clearedValues <
_shape
.FlattenedLength)
541
TensorSpanHelpers.AdjustIndexes(Rank - 2, 1, curIndexes,
_shape
.Lengths);
552
MemoryMarshal.CreateSpan<T>(ref _reference, (int)
_shape
._memoryLength).Fill(value);
673
new ReadOnlyTensorSpan<T>(ref span._reference, span.
_shape
.Lengths, span.
_shape
.Strides, span.
_shape
._memoryLength);
679
public override string ToString() => $"System.Numerics.Tensors.TensorSpan<{typeof(T).Name}>[{
_shape
.FlattenedLength}]";
767
if ((index >=
_shape
._memoryLength || index < 0) && flattenedLength != 0)
770
toReturn = new TensorSpan<T>(ref Unsafe.Add(ref _reference, index), lengths,
_shape
.Strides,
_shape
._memoryLength - index);
787
if (destination.Length <=
_shape
.FlattenedLength)
801
if (destination.Length <
_shape
.FlattenedLength)
804
if (
_shape
.FlattenedLength == 0)
822
while (copiedValues <
_shape
.FlattenedLength)
825
TensorSpanHelpers.AdjustIndexes(Rank - 2, 1, curIndexes,
_shape
.Lengths);