11 writes to _shape
System.Numerics.Tensors (11)
System\Numerics\Tensors\netcore\ReadOnlyTensorSpan_1.cs (11)
40_shape = TensorShape.Create(array); 75_shape = TensorShape.Create(array, lengths, strides); 99_shape = TensorShape.Create(array, start, lengths, strides); 111_shape = TensorShape.Create(ref reference, span.Length, pinned: false); 141_shape = TensorShape.Create(ref reference, span.Length, lengths, strides, pinned: false); 156_shape = TensorShape.Create(array); 186_shape = TensorShape.Create(array, start, lengths, strides, out nint linearOffset); 201_shape = TensorShape.Create(data, dataLength); 240_shape = TensorShape.Create(data, dataLength, lengths, strides); 246_shape = TensorShape.CreateForView(dataLength, lengths, strides, pinned); 253_shape = shape;
113 references to _shape
System.Numerics.Tensors (113)
System\Numerics\Tensors\netcore\ReadOnlyTensorDimensionSpan_1.cs (2)
24tensor = new ReadOnlyTensorSpan<T>(in tensor._reference, TensorShape.Normalize(tensor._shape)); 59nint linearOffset = _tensor._shape.GetLinearOffsetForDimension(index, _dimension);
System\Numerics\Tensors\netcore\ReadOnlyTensorSpan_1.cs (23)
259get => ref Unsafe.Add(ref _reference, _shape.GetLinearOffset<TensorShape.GetOffsetAndLengthForNInt, nint>(indexes)); 265get => ref Unsafe.Add(ref _reference, _shape.GetLinearOffset<TensorShape.GetOffsetAndLengthForNIndex, NIndex>(indexes)); 275public nint FlattenedLength => _shape.FlattenedLength; 278public bool HasAnyDenseDimensions => _shape.HasAnyDenseDimensions; 281public bool IsDense => _shape.IsDense; 284public bool IsEmpty => _shape.IsEmpty; 287public bool IsPinned => _shape.IsPinned; 291public ReadOnlySpan<nint> Lengths => _shape.Lengths; 298public ReadOnlySpan<nint> Strides => _shape.Strides; 307&& left._shape == right._shape; 331items._shape 384if (_shape.FlattenedLength != 0) ret = ref _reference; 411TensorShape shape = _shape.Slice<TensorShape.GetOffsetAndLengthForSlice, nint>(startIndexes, out nint linearOffset); 421TensorShape shape = _shape.Slice<TensorShape.GetOffsetAndLengthForNIndex, NIndex>(startIndexes, out nint linearOffset); 431TensorShape shape = _shape.Slice<TensorShape.GetOffsetAndLengthForNRange, NRange>(ranges, out nint linearOffset); 456if ((_shape.FlattenedLength <= destination.FlattenedLength) && 457TensorShape.AreCompatible(destination._shape, _shape, false)) 468if (_shape.FlattenedLength <= destination.Length) 480nint longestContiguousLength = _shape.GetLongestContiguousLength<TensorShape.GetOffsetAndLengthForNInt, nint>(startIndexes, out nint linearOffset); 496nint longestContiguousLength = _shape.GetLongestContiguousLength<TensorShape.GetOffsetAndLengthForNIndex, NIndex>(startIndexes, out nint linearOffset); 574if (_itemsEnumerated == _span._shape.FlattenedLength) 582: _span._shape.GetLinearOffsetForDimension(_itemsEnumerated, _span.Rank);
System\Numerics\Tensors\netcore\Tensor.cs (19)
274if (source._shape.Overlaps(in source._reference, ref destination._reference, destinationLinearLength)) 325source = new ReadOnlyTensorSpan<T>(in source._reference, TensorShape.WithRank(source._shape, targetRank)); 464source = new ReadOnlyTensorSpan<T>(in source._reference, TensorShape.WithRank(source._shape, rank)); 1770ref readonly TensorShape shape = ref TensorShape.Normalize(tensor._shape); 1781ReadOnlyTensorSpan<T> result = new ReadOnlyTensorSpan<T>(ref tensor._reference, tensor._shape.LinearLength, newLengths, strides, tensor.IsPinned); 1889if (tensor._shape.Overlaps(in tensor._reference, ref destination._reference, destination._shape.LinearLength)) 2035if (dimension < -1 || dimension >= TensorShape.Normalize(tensor._shape).Rank) 2044if (tensor._shape.Overlaps(in tensor._reference, ref destination._reference, destination._shape.LinearLength)) 2047&& TensorShape.AreLayoutsTheSame(tensor._shape, destination._shape)) 2049if ((tensor._shape.LinearLength == 1) || (dimension >= 0 && tensor.Lengths[dimension] == 1)) 2302alignedOther = new ReadOnlyTensorSpan<T>(in other._reference, TensorShape.WithRank(other._shape, rank)); 2306? TensorOperation.GetDenseSliceDimension(tensor._shape, alignedOther._shape) 2407ref readonly TensorShape shape = ref TensorShape.Normalize(tensor._shape); 2680ReadOnlyTensorSpan<T> output = new ReadOnlyTensorSpan<T>(ref tensor._reference, tensor._shape.LinearLength, lengths[..rank], strides[..rank], tensor.IsPinned); 2889nint linearOffset = tensor._shape.GetLinearOffsetForDimension(i, 1); 3032if (!TensorShape.AreCompatible(destination._shape, tensor._shape, false)) 3145ref readonly TensorShape shape = ref TensorShape.Normalize(tensor._shape); 3177ReadOnlyTensorSpan<T> output = new ReadOnlyTensorSpan<T>(ref tensor._reference, tensor._shape.LinearLength, newLengths, newStrides, tensor.IsPinned);
System\Numerics\Tensors\netcore\TensorOperation.cs (69)
28if (!source._shape.Overlaps(in source._reference, ref destination._reference, destination._shape.LinearLength)) 37&& TensorShape.AreLayoutsTheSame(source._shape, destination._shape)) 43if (!source._shape.IsSelfOverlapping) 105|| !source._shape.Overlaps(in source._reference, ref destination._reference, destination._shape.LinearLength)); 107int sourceDimension = source.IsDense ? -1 : GetDenseSliceDimension(source._shape, source._shape); 163int sourceDimension = input.IsDense ? -1 : GetDenseSliceDimension(input._shape, input._shape); 420TensorShape shape = TensorShape.Create(in source._reference, source._shape.LinearLength, destination.Lengths, strides, source.IsPinned); 514int dimension = GetDenseSliceDimension(x._shape, x._shape); 565linearOffset = x._shape.AdjustToNextIndex(x._shape, linearOffset, indexes); 684TensorShape destinationShape = GetBroadcastShape(x._shape, y._shape); 703int dimension = GetDenseSliceDimension(optimizedX._shape, destinationShape, optimizedY._shape, MinSlicedBinaryOperationLength); 722xLinearOffset = x._shape.AdjustToNextIndex(destinationShape, xLinearOffset, xIndexes); 723yLinearOffset = y._shape.AdjustToNextIndex(destinationShape, yLinearOffset, yIndexes); 726xLinearOffset = x._shape.AdjustToNextIndex(destinationShape, xLinearOffset, xIndexes); 727yLinearOffset = y._shape.AdjustToNextIndex(destinationShape, yLinearOffset, yIndexes); 816int dimension = GetDenseSliceDimension(x._shape, x._shape); 833xLinearOffset = x._shape.AdjustToNextIndex(x._shape, xLinearOffset, xIndexes); 836xLinearOffset = x._shape.AdjustToNextIndex(x._shape, xLinearOffset, xIndexes); 952int dimension = GetDenseSliceDimension(optimizedSource._shape, destination._shape); 974xLinearOffset = source._shape.AdjustToNextIndex(destination._shape, xLinearOffset, xIndexes); 1006xLinearOffset = source._shape.AdjustToNextIndex(destination._shape, xLinearOffset, xIndexes); 1034if (x._shape.Overlaps(in x._reference, ref destinationReference, result.Length)) 1040? GetDenseSliceDimension(x._shape, x._shape) 1064xLinearOffset = x._shape.AdjustToNextIndex(x._shape, xLinearOffset, xIndexes); 1096int dimension = GetDenseSliceDimension(x._shape, x._shape); 1111xLinearOffset = x._shape.AdjustToNextIndex(x._shape, xLinearOffset, xIndexes); 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); 1240TensorShape destinationShape = GetBroadcastShape(x._shape, y._shape); 1249int dimension = GetDenseSliceDimension(optimizedX._shape, destinationShape, optimizedY._shape, MinSlicedBinaryOperationLength); 1266xLinearOffset = x._shape.AdjustToNextIndex(destinationShape, xLinearOffset, xIndexes); 1267yLinearOffset = y._shape.AdjustToNextIndex(destinationShape, yLinearOffset, yIndexes); 1309int dimension = GetDenseSliceDimension(optimizedSource._shape, destination._shape); 1331xLinearOffset = source._shape.AdjustToNextIndex(destination._shape, xLinearOffset, xIndexes); 1366int dimension = GetDenseSliceDimension(optimizedSource._shape, destination._shape); 1388xLinearOffset = source._shape.AdjustToNextIndex(destination._shape, xLinearOffset, xIndexes); 1422int dimension = GetDenseSliceDimension(x._shape, x._shape); 1437xLinearOffset = x._shape.AdjustToNextIndex(x._shape, xLinearOffset, xIndexes); 1455if (!TensorShape.AreCompatible(lengths, x._shape)) 1462if (!TensorShape.AreCompatible(x._shape, y._shape, true)) 1469if (!TensorShape.AreCompatible(destination._shape, x._shape, false)) 1476if (TensorShape.AreCompatible(x._shape, y._shape, true)) 1478if (TensorShape.AreCompatible(destination._shape, x._shape, false)) 1480if (TensorShape.AreCompatible(destination._shape, y._shape, false)) 1493if (TensorShape.AreCompatible(x._shape, y._shape, true)) 1495ref readonly TensorShape xShape = ref TensorShape.Normalize(x._shape); 1496ref readonly TensorShape yShape = ref TensorShape.Normalize(y._shape);