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