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);
85 references to _shape
System.Numerics.Tensors (85)
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 (52)
192return new TensorSpan<T>(ref input._reference, shape, input.Strides, input._shape._memoryLength); 218TensorSpan<T> output = new TensorSpan<T>(ref input._reference, shape, strides, input._shape._memoryLength); 795Span<T> valuesSpan = MemoryMarshal.CreateSpan(ref values._reference, (int)values._shape._memoryLength); 2927ReadOnlyTensorSpan<T> output = new ReadOnlyTensorSpan<T>(ref tensor._reference, arrLengths, strides, tensor._shape._memoryLength); 2994ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref tensor._reference, (int)tensor._shape._memoryLength); 2996if (destination._shape._memoryLength > tensor._shape._memoryLength) 2997TensorSpanHelpers.Memmove(ospan, span, tensor._shape._memoryLength); 3051nint index = tensor._shape._memoryLength - 1; 3052Span<T> inputSpan = MemoryMarshal.CreateSpan(ref tensor._reference, (int)tensor._shape._memoryLength); 3054for (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)); 3428return new ReadOnlyTensorSpan<T>(ref tensor._reference, lengths, strides, tensor._shape._memoryLength); 3518Span<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x._shape._memoryLength); 3524T variance = sum / T.CreateChecked(x._shape._memoryLength); 3782return new ReadOnlyTensorSpan<T>(ref tensor._reference, lengths, strides, tensor._shape._memoryLength); 5215ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x._shape._memoryLength); 5226ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x._shape._memoryLength); 5237ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x._shape._memoryLength); 5250ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x._shape._memoryLength); 6016ReadOnlySpan<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); 6320if (destination._shape._memoryLength < x._shape._memoryLength) 6323ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x._shape._memoryLength); 6370if (destination._shape._memoryLength < x._shape._memoryLength) 6373ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x._shape._memoryLength); 6397if (destination._shape._memoryLength < x._shape._memoryLength) 6400ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x._shape._memoryLength); 6424if (destination._shape._memoryLength < x._shape._memoryLength) 6427ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x._shape._memoryLength); 6871ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref input._reference, (int)input._shape.FlattenedLength); 6891ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref left._reference, (int)left._shape.FlattenedLength); 6892ReadOnlySpan<T> rspan = MemoryMarshal.CreateSpan(ref right._reference, (int)right._shape.FlattenedLength); 6921if (destination._shape._memoryLength < input._shape.FlattenedLength) 6925TensorSpan<TOut> slicedDestination = destination.Slice(input._shape.Lengths); 6933inputSpan = MemoryMarshal.CreateSpan(ref input._reference, (int)input._shape.FlattenedLength); 6974if (destination._shape._memoryLength < input._shape.FlattenedLength) 6978TensorSpan<T> slicedDestination = destination.Slice(input._shape.Lengths); 7026if (destination._shape._memoryLength < input._shape.FlattenedLength) 7030TensorSpan<T> slicedDestination = destination.Slice(input._shape.Lengths); 7037inputSpan = MemoryMarshal.CreateSpan(ref input._reference, (int)input._shape._memoryLength); 7086ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref left._reference, left._shape._memoryLength <= left.FlattenedLength ? (int)left._shape._memoryLength : (int)left.FlattenedLength); 7087ReadOnlySpan<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);