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;
84 references to _shape
System.Numerics.Tensors (84)
System\Numerics\Tensors\netcore\ReadOnlyTensorSpan_1.cs (1)
457TensorShape.AreCompatible(destination._shape, _shape, false))
System\Numerics\Tensors\netcore\Tensor.cs (20)
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)); 479? TensorOperation.GetDenseSliceDimension(destination._shape, destination._shape) 536? TensorOperation.GetDenseSliceDimension(destination._shape, destination._shape) 1623return new Tensor<T>(tensor._values, tensor._start, reshaped._shape); 1657ref readonly TensorShape shape = ref TensorShape.Normalize(tensor._shape); 1668TensorSpan<T> result = new TensorSpan<T>(ref tensor._reference, tensor._shape.LinearLength, newLengths, strides, tensor.IsPinned); 1798if (destination._shape.IsSelfOverlapping) 1827if (tensor._shape.Overlaps(in tensor._reference, ref destination._reference, destination._shape.LinearLength)) 1908if (tensor._shape.Overlaps(in tensor._reference, ref destination._reference, destination._shape.LinearLength)) 1911&& TensorShape.AreLayoutsTheSame(tensor._shape, destination._shape)) 2324TensorSpan<T> output = new TensorSpan<T>(ref tensor._reference, tensor._shape.LinearLength, lengths[..rank], strides[..rank], tensor.IsPinned); 2721if (!TensorShape.AreCompatible(destination._shape, tensor._shape, false)) 2742return new Tensor<T>(tensor._values, tensor._start, unsqueezed._shape); 2789ref readonly TensorShape shape = ref TensorShape.Normalize(tensor._shape); 2821TensorSpan<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 (40)
28if (!source._shape.Overlaps(in source._reference, ref destination._reference, destination._shape.LinearLength)) 37&& TensorShape.AreLayoutsTheSame(source._shape, destination._shape)) 287if (GetDenseSliceDimension(x._shape, x._shape) is int dimension && dimension >= 0) 302linearOffset = x._shape.AdjustToNextIndex(x._shape, linearOffset, indexes); 406if (GetDenseSliceDimension(destination._shape, destination._shape) is int dimension && dimension >= 0) 421linearOffset = destination._shape.AdjustToNextIndex(destination._shape, linearOffset, indexes); 460ReadOnlyTensorSpan<TArg> optimizedSource = x.Lengths.SequenceEqual(destinationLengths) ? x : BroadcastSource(x, destination._shape); 469int dimension = GetDenseSliceDimension(optimizedSource._shape, destination._shape); 491xLinearOffset = source._shape.AdjustToNextIndex(destination._shape, xLinearOffset, xIndexes); 492destinationLinearOffset = destination._shape.AdjustToNextIndex(destination._shape, destinationLinearOffset, destinationIndexes); 510ReadOnlyTensorSpan<TArg> source = x.Lengths.SequenceEqual(destinationLengths) ? x : BroadcastSource(x, destination._shape); 519nint destinationLinearOffset = destination._shape.LinearLength - 1 - negInnermostStride; 523xLinearOffset = source._shape.AdjustToNextIndex(destination._shape, xLinearOffset, xIndexes); 524destinationLinearOffset = destination._shape.AdjustToPreviousIndex(destination._shape, destinationLinearOffset, destinationIndexes); 618ReadOnlyTensorSpan<TArg1> optimizedX = x.Lengths.SequenceEqual(destinationLengths) ? x : BroadcastSource(x, destination._shape); 619ReadOnlyTensorSpan<TArg2> optimizedY = y.Lengths.SequenceEqual(destinationLengths) ? y : BroadcastSource(y, destination._shape); 628int dimension = GetDenseSliceDimension(optimizedX._shape, destination._shape, optimizedY._shape, MinSlicedBinaryOperationLength); 654xLinearOffset = left._shape.AdjustToNextIndex(destination._shape, xLinearOffset, xIndexes); 655yLinearOffset = right._shape.AdjustToNextIndex(destination._shape, yLinearOffset, yIndexes); 656destinationLinearOffset = destination._shape.AdjustToNextIndex(destination._shape, destinationLinearOffset, destinationIndexes); 712ReadOnlyTensorSpan<TArg1> optimizedSource = x.Lengths.SequenceEqual(destinationLengths) ? x : BroadcastSource(x, destination._shape); 721int dimension = GetDenseSliceDimension(optimizedSource._shape, destination._shape); 743xLinearOffset = source._shape.AdjustToNextIndex(destination._shape, xLinearOffset, xIndexes); 744destinationLinearOffset = destination._shape.AdjustToNextIndex(destination._shape, destinationLinearOffset, destinationIndexes); 763ReadOnlyTensorSpan<TArg> optimizedSource = y.Lengths.SequenceEqual(destinationLengths) ? y : BroadcastSource(y, destination._shape); 772int dimension = GetDenseSliceDimension(optimizedSource._shape, destination._shape); 794xLinearOffset = source._shape.AdjustToNextIndex(destination._shape, xLinearOffset, xIndexes); 795destinationLinearOffset = destination._shape.AdjustToNextIndex(destination._shape, destinationLinearOffset, destinationIndexes); 847if (!TensorShape.AreCompatible(destination._shape, x._shape, false)) 856if (TensorShape.AreCompatible(destination._shape, x._shape, false)) 858if (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);