11 writes to _shape
System.Numerics.Tensors (11)
System\Numerics\Tensors\netcore\TensorSpan_1.cs (11)
38_shape = TensorShape.Create(array); 55_shape = TensorShape.Create(array, lengths, strides); 67_shape = TensorShape.Create(array, start, lengths, strides); 77_shape = TensorShape.Create(ref reference, span.Length, pinned: false); 89_shape = TensorShape.Create(ref reference, span.Length, lengths, strides, pinned: false); 99_shape = TensorShape.Create(array); 111_shape = TensorShape.Create(array, start, lengths, strides, out nint linearOffset); 121_shape = TensorShape.Create(data, dataLength); 134_shape = TensorShape.Create(data, dataLength, lengths, strides); 140_shape = TensorShape.CreateForView(dataLength, lengths, strides, pinned); 147_shape = shape;
96 references to _shape
System.Numerics.Tensors (96)
System\Numerics\Tensors\netcore\ReadOnlyTensorSpan_1.cs (1)
457TensorShape.AreCompatible(destination._shape, _shape, false))
System\Numerics\Tensors\netcore\Tensor.cs (25)
231ReadOnlySpan<nint> destinationLengths = TensorShape.Normalize(destination._shape).Lengths; 260if (destination._shape.IsSelfOverlapping) 270nint destinationLinearLength = destination._shape.LinearLength; 294alignedTarget = new TensorSpan<T>(ref destination._reference, TensorShape.WithRank(destination._shape, rank)); 428nint linearOffset = destination.IsDense ? offset++ : destination._shape.GetLinearOffsetForDimension(offset++, destination.Rank); 556? TensorOperation.GetDenseSliceDimension(destination._shape, destination._shape) 617? TensorOperation.GetDenseSliceDimension(destination._shape, destination._shape) 1704return new Tensor<T>(tensor._values, tensor._start, reshaped._shape); 1738ref readonly TensorShape shape = ref TensorShape.Normalize(tensor._shape); 1749TensorSpan<T> result = new TensorSpan<T>(ref tensor._reference, tensor._shape.LinearLength, newLengths, strides, tensor.IsPinned); 1866if (destination._shape.IsSelfOverlapping) 1889if (tensor._shape.Overlaps(in tensor._reference, ref destination._reference, destination._shape.LinearLength)) 1931int dimension = TensorOperation.GetDenseSliceDimension(destination._shape, destination._shape); 1983nint linearOffset = destination._shape.GetLinearOffsetForDimension(i, destination.Rank); 2044if (tensor._shape.Overlaps(in tensor._reference, ref destination._reference, destination._shape.LinearLength)) 2047&& TensorShape.AreLayoutsTheSame(tensor._shape, destination._shape)) 2601TensorSpan<T> output = new TensorSpan<T>(ref tensor._reference, tensor._shape.LinearLength, lengths[..rank], strides[..rank], tensor.IsPinned); 2794alignedTarget = new TensorSpan<T>(ref destination._reference, TensorShape.WithRank(destination._shape, rank + 1)); 3032if (!TensorShape.AreCompatible(destination._shape, tensor._shape, false)) 3053return new Tensor<T>(tensor._values, tensor._start, unsqueezed._shape); 3100ref readonly TensorShape shape = ref TensorShape.Normalize(tensor._shape); 3132TensorSpan<T> output = new TensorSpan<T>(ref tensor._reference, tensor._shape.LinearLength, newLengths, newStrides, tensor.IsPinned);
System\Numerics\Tensors\netcore\TensorDimensionSpan_1.cs (2)
24tensor = new TensorSpan<T>(ref tensor._reference, TensorShape.Normalize(tensor._shape)); 59nint linearOffset = _tensor._shape.GetLinearOffsetForDimension(index, _dimension);
System\Numerics\Tensors\netcore\TensorOperation.cs (47)
28if (!source._shape.Overlaps(in source._reference, ref destination._reference, destination._shape.LinearLength)) 37&& TensorShape.AreLayoutsTheSame(source._shape, destination._shape)) 105|| !source._shape.Overlaps(in source._reference, ref destination._reference, destination._shape.LinearLength)); 126int destinationDimension = GetDenseSliceDimension(destination._shape, destination._shape); 162ReadOnlyTensorSpan<T> input = source.Lengths.SequenceEqual(destination.Lengths) ? source : BroadcastSource(source, destination._shape); 164int destinationDimension = destination.IsDense ? -1 : GetDenseSliceDimension(destination._shape, destination._shape); 623if (GetDenseSliceDimension(x._shape, x._shape) is int dimension && dimension >= 0) 638linearOffset = x._shape.AdjustToNextIndex(x._shape, linearOffset, indexes); 874if (GetDenseSliceDimension(destination._shape, destination._shape) is int dimension && dimension >= 0) 889linearOffset = destination._shape.AdjustToNextIndex(destination._shape, linearOffset, indexes); 928ReadOnlyTensorSpan<TArg> optimizedSource = x.Lengths.SequenceEqual(destinationLengths) ? x : BroadcastSource(x, destination._shape); 946if (TryCopyDenseSlices(optimizedSource, new TensorSpan<TArg>(ref destinationReference, destination._shape), destination.FlattenedLength)) 952int dimension = GetDenseSliceDimension(optimizedSource._shape, destination._shape); 974xLinearOffset = source._shape.AdjustToNextIndex(destination._shape, xLinearOffset, xIndexes); 975destinationLinearOffset = destination._shape.AdjustToNextIndex(destination._shape, destinationLinearOffset, destinationIndexes); 993ReadOnlyTensorSpan<TArg> source = x.Lengths.SequenceEqual(destinationLengths) ? x : BroadcastSource(x, destination._shape); 1002nint destinationLinearOffset = destination._shape.LinearLength - 1 - negInnermostStride; 1006xLinearOffset = source._shape.AdjustToNextIndex(destination._shape, xLinearOffset, xIndexes); 1007destinationLinearOffset = destination._shape.AdjustToPreviousIndex(destination._shape, destinationLinearOffset, destinationIndexes); 1158ReadOnlyTensorSpan<TArg1> optimizedX = x.Lengths.SequenceEqual(destinationLengths) ? x : BroadcastSource(x, destination._shape); 1159ReadOnlyTensorSpan<TArg2> optimizedY = y.Lengths.SequenceEqual(destinationLengths) ? y : BroadcastSource(y, destination._shape); 1174int dimension = GetDenseSliceDimension(optimizedX._shape, destination._shape, optimizedY._shape, MinSlicedBinaryOperationLength); 1200xLinearOffset = left._shape.AdjustToNextIndex(destination._shape, xLinearOffset, xIndexes); 1201yLinearOffset = right._shape.AdjustToNextIndex(destination._shape, yLinearOffset, yIndexes); 1202destinationLinearOffset = destination._shape.AdjustToNextIndex(destination._shape, destinationLinearOffset, destinationIndexes); 1294ReadOnlyTensorSpan<TArg1> optimizedSource = x.Lengths.SequenceEqual(destinationLengths) ? x : BroadcastSource(x, destination._shape); 1309int dimension = GetDenseSliceDimension(optimizedSource._shape, destination._shape); 1331xLinearOffset = source._shape.AdjustToNextIndex(destination._shape, xLinearOffset, xIndexes); 1332destinationLinearOffset = destination._shape.AdjustToNextIndex(destination._shape, destinationLinearOffset, destinationIndexes); 1351ReadOnlyTensorSpan<TArg> optimizedSource = y.Lengths.SequenceEqual(destinationLengths) ? y : BroadcastSource(y, destination._shape); 1366int dimension = GetDenseSliceDimension(optimizedSource._shape, destination._shape); 1388xLinearOffset = source._shape.AdjustToNextIndex(destination._shape, xLinearOffset, xIndexes); 1389destinationLinearOffset = destination._shape.AdjustToNextIndex(destination._shape, destinationLinearOffset, destinationIndexes); 1469if (!TensorShape.AreCompatible(destination._shape, x._shape, false)) 1478if (TensorShape.AreCompatible(destination._shape, x._shape, false)) 1480if (TensorShape.AreCompatible(destination._shape, y._shape, false))
System\Numerics\Tensors\netcore\TensorSpan_1.cs (21)
153get => ref Unsafe.Add(ref _reference, _shape.GetLinearOffset<TensorShape.GetOffsetAndLengthForNInt, nint>(indexes)); 159get => ref Unsafe.Add(ref _reference, _shape.GetLinearOffset<TensorShape.GetOffsetAndLengthForNIndex, NIndex>(indexes)); 170public nint FlattenedLength => _shape.FlattenedLength; 173public bool HasAnyDenseDimensions => _shape.HasAnyDenseDimensions; 176public bool IsDense => _shape.IsDense; 179public bool IsEmpty => _shape.IsEmpty; 182public bool IsPinned => _shape.IsPinned; 186public ReadOnlySpan<nint> Lengths => _shape.Lengths; 193public ReadOnlySpan<nint> Strides => _shape.Strides; 198&& left._shape == right._shape; 212new ReadOnlyTensorSpan<T>(ref tensor._reference, tensor._shape); 215public ReadOnlyTensorSpan<T> AsReadOnlyTensorSpan() => new ReadOnlyTensorSpan<T>(ref _reference, in _shape); 274if (_shape.FlattenedLength != 0) ret = ref _reference; 301TensorShape shape = _shape.Slice<TensorShape.GetOffsetAndLengthForSlice, nint>(startIndexes, out nint linearOffset); 311TensorShape shape = _shape.Slice<TensorShape.GetOffsetAndLengthForNIndex, NIndex>(startIndexes, out nint linearOffset); 321TensorShape shape = _shape.Slice<TensorShape.GetOffsetAndLengthForNRange, NRange>(ranges, out nint linearOffset); 344nint longestContiguousLength = _shape.GetLongestContiguousLength<TensorShape.GetOffsetAndLengthForNInt, nint>(startIndexes, out nint linearOffset); 360nint longestContiguousLength = _shape.GetLongestContiguousLength<TensorShape.GetOffsetAndLengthForNIndex, NIndex>(startIndexes, out nint linearOffset); 495if (_itemsEnumerated == _span._shape.FlattenedLength) 503: _span._shape.GetLinearOffsetForDimension(_itemsEnumerated, _span.Rank);