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); 2922ReadOnlyTensorSpan<T> output = new ReadOnlyTensorSpan<T>(ref tensor._reference, arrLengths, strides, tensor._shape._memoryLength); 2989ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref tensor._reference, (int)tensor._shape._memoryLength); 2991if (destination._shape._memoryLength > tensor._shape._memoryLength) 2992TensorSpanHelpers.Memmove(ospan, span, tensor._shape._memoryLength); 3046nint index = tensor._shape._memoryLength - 1; 3047Span<T> inputSpan = MemoryMarshal.CreateSpan(ref tensor._reference, (int)tensor._shape._memoryLength); 3049for (int i = 0; i <= tensor._shape._memoryLength / 2; i++) 3117&& tensor._shape._memoryLength == other._shape._memoryLength 3119&& MemoryMarshal.CreateReadOnlySpan(in tensor.GetPinnableReference(), (int)tensor._shape._memoryLength).SequenceEqual(MemoryMarshal.CreateReadOnlySpan(in other.GetPinnableReference(), (int)other._shape._memoryLength)); 3129&& tensor._shape._memoryLength == other._shape._memoryLength 3131&& MemoryMarshal.CreateReadOnlySpan(in tensor.GetPinnableReference(), (int)tensor._shape._memoryLength).SequenceEqual(MemoryMarshal.CreateReadOnlySpan(in other.GetPinnableReference(), (int)other._shape._memoryLength)); 3423return new ReadOnlyTensorSpan<T>(ref tensor._reference, lengths, strides, tensor._shape._memoryLength); 3513Span<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x._shape._memoryLength); 3519return T.CreateChecked(sum / T.CreateChecked(x._shape._memoryLength)); 3720return new ReadOnlyTensorSpan<T>(ref tensor._reference, lengths, strides, tensor._shape._memoryLength); 5153ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x._shape._memoryLength); 5164ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x._shape._memoryLength); 5175ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x._shape._memoryLength); 5188ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x._shape._memoryLength); 5954ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x._shape._memoryLength); 6196if (destination._shape._memoryLength < x._shape._memoryLength) 6199ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x._shape._memoryLength); 6227if (destination._shape._memoryLength < x._shape._memoryLength) 6230ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x._shape._memoryLength); 6258if (destination._shape._memoryLength < x._shape._memoryLength) 6261ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x._shape._memoryLength); 6308if (destination._shape._memoryLength < x._shape._memoryLength) 6311ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x._shape._memoryLength); 6335if (destination._shape._memoryLength < x._shape._memoryLength) 6338ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x._shape._memoryLength); 6362if (destination._shape._memoryLength < x._shape._memoryLength) 6365ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x._shape._memoryLength); 6809ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref input._reference, (int)input._shape.FlattenedLength); 6829ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref left._reference, (int)left._shape.FlattenedLength); 6830ReadOnlySpan<T> rspan = MemoryMarshal.CreateSpan(ref right._reference, (int)right._shape.FlattenedLength); 6859if (destination._shape._memoryLength < input._shape.FlattenedLength) 6863TensorSpan<TOut> slicedDestination = destination.Slice(input._shape.Lengths); 6871inputSpan = MemoryMarshal.CreateSpan(ref input._reference, (int)input._shape.FlattenedLength); 6912if (destination._shape._memoryLength < input._shape.FlattenedLength) 6916TensorSpan<T> slicedDestination = destination.Slice(input._shape.Lengths); 6964if (destination._shape._memoryLength < input._shape.FlattenedLength) 6968TensorSpan<T> slicedDestination = destination.Slice(input._shape.Lengths); 6975inputSpan = MemoryMarshal.CreateSpan(ref input._reference, (int)input._shape._memoryLength); 7024ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref left._reference, left._shape._memoryLength <= left.FlattenedLength ? (int)left._shape._memoryLength : (int)left.FlattenedLength); 7025ReadOnlySpan<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);