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)
332if (index >= _shape._memoryLength || index < 0) 355if (index >= _shape._memoryLength || index < 0) 384public nint FlattenedLength => _shape.FlattenedLength; 390public bool IsEmpty => _shape.IsEmpty; 396public ReadOnlySpan<nint> Lengths => _shape.Lengths; 407public ReadOnlySpan<nint> Strides => _shape.Strides; 420left._shape.FlattenedLength == right._shape.FlattenedLength && 422left._shape.Lengths.SequenceEqual(right._shape.Lengths )&& 463return new ReadOnlyTensorSpan<T>(ref Unsafe.As<TDerived, T>(ref items._reference), items._shape.Lengths, items._shape.Strides, items._shape._memoryLength); 521if (_shape.FlattenedLength != 0) ret = ref _reference; 646public override string ToString() => $"System.Numerics.Tensors.ReadOnlyTensorSpan<{typeof(T).Name}>[{_shape.FlattenedLength}]"; 732if ((index >= _shape._memoryLength || index < 0) && flattenedLength != 0) 735toReturn = new ReadOnlyTensorSpan<T>(ref Unsafe.Add(ref _reference, index), lengths, _shape.Strides, _shape._memoryLength - index); 752if (destination.Length < _shape.FlattenedLength) 769while (copiedValues < _shape.FlattenedLength) 772TensorSpanHelpers.AdjustIndexes(Rank - 2, 1, curIndexes, _shape.Lengths); 789if (destination.Length < _shape.FlattenedLength) 792if (_shape.FlattenedLength == 0) 810while (copiedValues < _shape.FlattenedLength) 820TensorSpanHelpers.AdjustIndexes(Rank - 2, 1, curIndexes, _shape.Lengths);
System\Numerics\Tensors\netcore\TensorExtensions.cs (50)
178return new TensorSpan<T>(ref input._reference, shape, input.Strides, input._shape._memoryLength); 204TensorSpan<T> output = new TensorSpan<T>(ref input._reference, shape, strides, input._shape._memoryLength); 781Span<T> valuesSpan = MemoryMarshal.CreateSpan(ref values._reference, (int)values._shape._memoryLength); 2913ReadOnlyTensorSpan<T> output = new ReadOnlyTensorSpan<T>(ref tensor._reference, arrLengths, strides, tensor._shape._memoryLength); 2980ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref tensor._reference, (int)tensor._shape._memoryLength); 2982if (destination._shape._memoryLength > tensor._shape._memoryLength) 2983TensorSpanHelpers.Memmove(ospan, span, tensor._shape._memoryLength); 3037nint index = tensor._shape._memoryLength - 1; 3038Span<T> inputSpan = MemoryMarshal.CreateSpan(ref tensor._reference, (int)tensor._shape._memoryLength); 3040for (int i = 0; i <= tensor._shape._memoryLength / 2; i++) 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)); 3120&& tensor._shape._memoryLength == other._shape._memoryLength 3122&& MemoryMarshal.CreateReadOnlySpan(in tensor.GetPinnableReference(), (int)tensor._shape._memoryLength).SequenceEqual(MemoryMarshal.CreateReadOnlySpan(in other.GetPinnableReference(), (int)other._shape._memoryLength)); 3414return new ReadOnlyTensorSpan<T>(ref tensor._reference, lengths, strides, tensor._shape._memoryLength); 3738return new ReadOnlyTensorSpan<T>(ref tensor._reference, lengths, strides, tensor._shape._memoryLength); 5184ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x._shape._memoryLength); 5195ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x._shape._memoryLength); 5206ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x._shape._memoryLength); 5219ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x._shape._memoryLength); 5985ReadOnlySpan<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); 6289if (destination._shape._memoryLength < x._shape._memoryLength) 6292ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x._shape._memoryLength); 6339if (destination._shape._memoryLength < x._shape._memoryLength) 6342ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x._shape._memoryLength); 6366if (destination._shape._memoryLength < x._shape._memoryLength) 6369ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x._shape._memoryLength); 6393if (destination._shape._memoryLength < x._shape._memoryLength) 6396ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x._shape._memoryLength); 6866ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref input._reference, (int)input._shape.FlattenedLength); 6886ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref left._reference, (int)left._shape.FlattenedLength); 6887ReadOnlySpan<T> rspan = MemoryMarshal.CreateSpan(ref right._reference, (int)right._shape.FlattenedLength); 6916if (destination._shape._memoryLength < input._shape.FlattenedLength) 6920TensorSpan<TOut> slicedDestination = destination.Slice(input._shape.Lengths); 6928inputSpan = MemoryMarshal.CreateSpan(ref input._reference, (int)input._shape.FlattenedLength); 6969if (destination._shape._memoryLength < input._shape.FlattenedLength) 6973TensorSpan<T> slicedDestination = destination.Slice(input._shape.Lengths); 7021if (destination._shape._memoryLength < input._shape.FlattenedLength) 7025TensorSpan<T> slicedDestination = destination.Slice(input._shape.Lengths); 7032inputSpan = MemoryMarshal.CreateSpan(ref input._reference, (int)input._shape._memoryLength); 7081ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref left._reference, left._shape._memoryLength <= left.FlattenedLength ? (int)left._shape._memoryLength : (int)left.FlattenedLength); 7082ReadOnlySpan<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)
20Span<bool> filterSpan = MemoryMarshal.CreateSpan(ref filter._reference, (int)filter._shape._memoryLength); 90=> tensor1._shape._memoryLength == tensor2._shape._memoryLength; 104if (tensor._shape.Strides[^1] != 1) 108for (int i = tensor._shape._rank - 2; i >= 0; i--) 110if (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);