17 writes to _shape
System.Numerics.Tensors (17)
System\Numerics\Tensors\netcore\TensorSpan.cs (17)
38_shape = TensorShape.Create(array); 50_shape = TensorShape.Create(array, lengths); 62_shape = TensorShape.Create(array, lengths, strides); 74_shape = TensorShape.Create(array, start, lengths, strides); 84_shape = TensorShape.Create(ref reference, span.Length); 92_shape = TensorShape.Create(ref reference, span.Length, lengths); 100_shape = TensorShape.Create(ref reference, span.Length, lengths, strides); 110_shape = TensorShape.Create(array); 122_shape = TensorShape.Create(array, start, lengths, strides, out nint linearOffset); 132_shape = TensorShape.Create(data, dataLength); 140_shape = TensorShape.Create(data, dataLength, lengths); 148_shape = TensorShape.Create(data, dataLength, lengths, strides); 154_shape = TensorShape.Create(ref data, dataLength); 160_shape = TensorShape.Create(ref data, dataLength, lengths); 166_shape = TensorShape.Create(ref data, dataLength, lengths, strides); 172_shape = TensorShape.Create(ref data, dataLength, lengths, strides, linearRankOrder); 179_shape = shape;
58 references to _shape
System.Numerics.Tensors (58)
System\Numerics\Tensors\netcore\ReadOnlyTensorSpan_1.cs (1)
444if (TensorShape.AreCompatible(destination._shape, _shape, false))
System\Numerics\Tensors\netcore\Tensor.cs (13)
462Span<T> span = MemoryMarshal.CreateSpan<T>(ref destination._reference, (int)destination._shape.LinearLength); 485Span<T> span = MemoryMarshal.CreateSpan<T>(ref destination._reference, (int)destination._shape.LinearLength); 1576TensorSpan<T> output = new TensorSpan<T>(ref tensor._reference, tensor._shape.LinearLength, newLengths, strides); 1709Span<T> ospan = MemoryMarshal.CreateSpan(ref destination._reference, (int)destination._shape.LinearLength); 1804&& tensor._shape.LinearLength == other._shape.LinearLength 1806&& MemoryMarshal.CreateReadOnlySpan(in tensor.GetPinnableReference(), (int)tensor._shape.LinearLength).SequenceEqual(MemoryMarshal.CreateReadOnlySpan(in other.GetPinnableReference(), (int)other._shape.LinearLength)); 2021strideOrder[index++] = tensor._shape.LinearRankOrder[i]; 2025removed[removedIndex++] = tensor._shape.LinearRankOrder[i]; 2045strideOrder[index++] = tensor._shape.LinearRankOrder[i]; 2049removed = tensor._shape.LinearRankOrder[i]; 2055TensorSpan<T> output = new TensorSpan<T>(ref tensor._reference, tensor._shape.LinearLength, lengths[..newRank], strides[..newRank], strideOrder[..newRank]); 2419if (!TensorShape.AreCompatible(destination._shape, tensor._shape, false)) 2496TensorSpan<T> output = new TensorSpan<T>(ref tensor._reference, tensor._shape.LinearLength, newLengths, newStrides);
System\Numerics\Tensors\netcore\TensorOperation.cs (24)
20linearOffset = x._shape.AdjustToNextIndex(x._shape, linearOffset, indexes); 96linearOffset = destination._shape.AdjustToNextIndex(destination._shape, linearOffset, indexes); 114xLinearOffset = x._shape.AdjustToNextIndex(destination._shape, xLinearOffset, xIndexes); 115destinationLinearOffset = destination._shape.AdjustToNextIndex(destination._shape, destinationLinearOffset, destinationIndexes); 138nint destinationLinearOffset = destination._shape.LinearLength; 142xLinearOffset = x._shape.AdjustToNextIndex(destination._shape, xLinearOffset, xIndexes); 143destinationLinearOffset = destination._shape.AdjustToPreviousIndex(destination._shape, destinationLinearOffset, destinationIndexes); 203xLinearOffset = x._shape.AdjustToNextIndex(destination._shape, xLinearOffset, xIndexes); 204yLinearOffset = y._shape.AdjustToNextIndex(destination._shape, yLinearOffset, yIndexes); 205destinationLinearOffset = destination._shape.AdjustToNextIndex(destination._shape, destinationLinearOffset, destinationIndexes); 263xLinearOffset = x._shape.AdjustToNextIndex(destination._shape, xLinearOffset, xIndexes); 264destinationLinearOffset = destination._shape.AdjustToNextIndex(destination._shape, destinationLinearOffset, destinationIndexes); 285xLinearOffset = y._shape.AdjustToNextIndex(destination._shape, xLinearOffset, xIndexes); 286destinationLinearOffset = destination._shape.AdjustToNextIndex(destination._shape, destinationLinearOffset, destinationIndexes); 338if (!TensorShape.AreCompatible(destination._shape, x._shape, false)) 347if (TensorShape.AreCompatible(destination._shape, x._shape, false)) 349if (TensorShape.AreCompatible(destination._shape, y._shape, false))
System\Numerics\Tensors\netcore\TensorSpan.cs (20)
185get => ref Unsafe.Add(ref _reference, _shape.GetLinearOffset<TensorShape.GetOffsetAndLengthForNInt, nint>(indexes)); 191get => ref Unsafe.Add(ref _reference, _shape.GetLinearOffset<TensorShape.GetOffsetAndLengthForNIndex, NIndex>(indexes)); 202public nint FlattenedLength => _shape.FlattenedLength; 205public bool HasAnyDenseDimensions => _shape.HasAnyDenseDimensions; 208public bool IsDense => _shape.IsDense; 211public bool IsEmpty => _shape.IsEmpty; 215public ReadOnlySpan<nint> Lengths => _shape.Lengths; 222public ReadOnlySpan<nint> Strides => _shape.Strides; 227&& left._shape == right._shape; 241new ReadOnlyTensorSpan<T>(ref tensor._reference, tensor._shape); 244public ReadOnlyTensorSpan<T> AsReadOnlyTensorSpan() => new ReadOnlyTensorSpan<T>(ref _reference, in _shape); 300if (_shape.FlattenedLength != 0) ret = ref _reference; 307TensorShape shape = _shape.Slice<TensorShape.GetOffsetAndLengthForNInt, nint>(startIndexes, out nint linearOffset); 317TensorShape shape = _shape.Slice<TensorShape.GetOffsetAndLengthForNIndex, NIndex>(startIndexes, out nint linearOffset); 327TensorShape shape = _shape.Slice<TensorShape.GetOffsetAndLengthForNRange, NRange>(ranges, out nint linearOffset); 335public override string ToString() => $"System.Numerics.Tensors.TensorSpan<{typeof(T).Name}>[{_shape}]"; 368if (_itemsEnumerated == _span._shape.FlattenedLength) 373_linearOffset = _span._shape.AdjustToNextIndex(_span._shape, _linearOffset, _indexes);