15 writes to _shape
System.Numerics.Tensors (15)
System\Numerics\Tensors\netcore\ReadOnlyTensorSpan_1.cs (11)
43_shape = TensorShape.Create(array); 78_shape = TensorShape.Create(array, lengths, strides); 102_shape = TensorShape.Create(array, start, lengths, strides); 114_shape = TensorShape.Create(ref reference, span.Length, pinned: false); 144_shape = TensorShape.Create(ref reference, span.Length, lengths, strides, pinned: false); 156_shape = TensorShape.Create(array); 183_shape = TensorShape.Create(array, start, lengths, strides, out nint linearOffset); 198_shape = TensorShape.Create(data, dataLength); 237_shape = TensorShape.Create(data, dataLength, lengths, strides); 243_shape = TensorShape.Create(in data, dataLength, lengths, strides, pinned); 250_shape = shape;
System\Numerics\Tensors\netcore\TensorOperation.cs (4)
34ref readonly TensorShape destinationShape = ref ((x._shape.FlattenedLength > y._shape.FlattenedLength) ? ref x._shape : ref y._shape); 226ref readonly TensorShape destinationShape = ref ((x._shape.FlattenedLength > y._shape.FlattenedLength) ? ref x._shape : ref y._shape);
74 references to _shape
System.Numerics.Tensors (74)
System\Numerics\Tensors\netcore\ReadOnlyTensorDimensionSpan_1.cs (1)
54nint linearOffset = _tensor._shape.GetLinearOffsetForDimension(index, _dimension);
System\Numerics\Tensors\netcore\ReadOnlyTensorSpan_1.cs (24)
256get => ref Unsafe.Add(ref _reference, _shape.GetLinearOffset<TensorShape.GetOffsetAndLengthForNInt, nint>(indexes)); 262get => ref Unsafe.Add(ref _reference, _shape.GetLinearOffset<TensorShape.GetOffsetAndLengthForNIndex, NIndex>(indexes)); 272public nint FlattenedLength => _shape.FlattenedLength; 275public bool HasAnyDenseDimensions => _shape.HasAnyDenseDimensions; 278public bool IsDense => _shape.IsDense; 281public bool IsEmpty => _shape.IsEmpty; 284public bool IsPinned => _shape.IsPinned; 288public ReadOnlySpan<nint> Lengths => _shape.Lengths; 295public ReadOnlySpan<nint> Strides => _shape.Strides; 304&& left._shape == right._shape; 328items._shape 381if (_shape.FlattenedLength != 0) ret = ref _reference; 408TensorShape shape = _shape.Slice<TensorShape.GetOffsetAndLengthForNInt, nint>(startIndexes, out nint linearOffset); 418TensorShape shape = _shape.Slice<TensorShape.GetOffsetAndLengthForNIndex, NIndex>(startIndexes, out nint linearOffset); 428TensorShape shape = _shape.Slice<TensorShape.GetOffsetAndLengthForNRange, NRange>(ranges, out nint linearOffset); 437public override string ToString() => $"System.Numerics.Tensors.ReadOnlyTensorSpan<{typeof(T).Name}>[{_shape}]"; 442if (TensorShape.AreCompatible(destination._shape, _shape, false)) 453if (_shape.FlattenedLength <= destination.Length) 465nint longestContiguousLength = _shape.GetLongestContiguousLength<TensorShape.GetOffsetAndLengthForNInt, nint>(startIndexes, out nint linearOffset); 481nint longestContiguousLength = _shape.GetLongestContiguousLength<TensorShape.GetOffsetAndLengthForNIndex, NIndex>(startIndexes, out nint linearOffset); 554if (_itemsEnumerated == _span._shape.FlattenedLength) 559_linearOffset = _span._shape.AdjustToNextIndex(_span._shape, _linearOffset, _indexes);
System\Numerics\Tensors\netcore\Tensor.cs (15)
1535ReadOnlyTensorSpan<T> output = new ReadOnlyTensorSpan<T>(ref tensor._reference, tensor._shape.LinearLength, newLengths, strides, tensor.IsPinned); 1592ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref tensor._reference, (int)tensor._shape.LinearLength); 1688&& tensor._shape.LinearLength == other._shape.LinearLength 1690&& MemoryMarshal.CreateReadOnlySpan(in tensor.GetPinnableReference(), (int)tensor._shape.LinearLength).SequenceEqual(MemoryMarshal.CreateReadOnlySpan(in other.GetPinnableReference(), (int)other._shape.LinearLength)); 1700&& tensor._shape.LinearLength == other._shape.LinearLength 1702&& MemoryMarshal.CreateReadOnlySpan(in tensor.GetPinnableReference(), (int)tensor._shape.LinearLength).SequenceEqual(MemoryMarshal.CreateReadOnlySpan(in other.GetPinnableReference(), (int)other._shape.LinearLength)); 1977ReadOnlyTensorSpan<T> output = new ReadOnlyTensorSpan<T>(ref tensor._reference, tensor._shape.LinearLength, lengths[..rank], strides[..rank], tensor.IsPinned); 2226if (!TensorShape.AreCompatible(destination._shape, tensor._shape, false)) 2340ReadOnlyTensorSpan<T> output = new ReadOnlyTensorSpan<T>(ref tensor._reference, tensor._shape.LinearLength, newLengths, newStrides, tensor.IsPinned); 3735ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x._shape.LinearLength); 3747ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x._shape.LinearLength); 3758ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x._shape.LinearLength); 3771ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x._shape.LinearLength);
System\Numerics\Tensors\netcore\TensorOperation.cs (34)
34ref readonly TensorShape destinationShape = ref ((x._shape.FlattenedLength > y._shape.FlattenedLength) ? ref x._shape : ref y._shape); 40xLinearOffset = x._shape.AdjustToNextIndex(destinationShape, xLinearOffset, xIndexes); 41yLinearOffset = y._shape.AdjustToNextIndex(destinationShape, yLinearOffset, yIndexes); 70xLinearOffset = x._shape.AdjustToNextIndex(x._shape, xLinearOffset, xIndexes); 114xLinearOffset = x._shape.AdjustToNextIndex(destination._shape, xLinearOffset, xIndexes); 142xLinearOffset = x._shape.AdjustToNextIndex(destination._shape, xLinearOffset, xIndexes); 164xLinearOffset = x._shape.AdjustToNextIndex(x._shape, xLinearOffset, xIndexes); 183xLinearOffset = x._shape.AdjustToNextIndex(x._shape, xLinearOffset, xIndexes); 203xLinearOffset = x._shape.AdjustToNextIndex(destination._shape, xLinearOffset, xIndexes); 204yLinearOffset = y._shape.AdjustToNextIndex(destination._shape, yLinearOffset, yIndexes); 226ref readonly TensorShape destinationShape = ref ((x._shape.FlattenedLength > y._shape.FlattenedLength) ? ref x._shape : ref y._shape); 233xLinearOffset = x._shape.AdjustToNextIndex(destinationShape, xLinearOffset, xIndexes); 234yLinearOffset = y._shape.AdjustToNextIndex(destinationShape, yLinearOffset, yIndexes); 263xLinearOffset = x._shape.AdjustToNextIndex(destination._shape, xLinearOffset, xIndexes); 285xLinearOffset = y._shape.AdjustToNextIndex(destination._shape, xLinearOffset, xIndexes); 306xLinearOffset = x._shape.AdjustToNextIndex(x._shape, xLinearOffset, xIndexes); 324if (!TensorShape.AreCompatible(lengths, x._shape)) 331if (!TensorShape.AreCompatible(x._shape, y._shape, true)) 338if (!TensorShape.AreCompatible(destination._shape, x._shape, false)) 345if (TensorShape.AreCompatible(x._shape, y._shape, true)) 347if (TensorShape.AreCompatible(destination._shape, x._shape, false)) 349if (TensorShape.AreCompatible(destination._shape, y._shape, false)) 362if (TensorShape.AreCompatible(x._shape, y._shape, true)) 366destination = Tensor.CreateFromShapeUninitialized<TResult>(x._shape.Lengths); 370destination = Tensor.CreateFromShapeUninitialized<TResult>(y._shape.Lengths);