21 writes to _shape
System.Numerics.Tensors (21)
System\Numerics\Tensors\netcore\ReadOnlyTensorSpan_1.cs (17)
41_shape = TensorShape.Create(array); 59_shape = TensorShape.Create(array, lengths); 81_shape = TensorShape.Create(array, lengths, strides); 105_shape = TensorShape.Create(array, start, lengths, strides); 117_shape = TensorShape.Create(ref reference, span.Length); 132_shape = TensorShape.Create(ref reference, span.Length, lengths); 151_shape = TensorShape.Create(ref reference, span.Length, lengths, strides); 163_shape = TensorShape.Create(array); 190_shape = TensorShape.Create(array, start, lengths, strides, out nint linearOffset); 205_shape = TensorShape.Create(data, dataLength); 224_shape = TensorShape.Create(data, dataLength, lengths); 247_shape = TensorShape.Create(data, dataLength, lengths, strides); 254_shape = TensorShape.Create(ref data, dataLength); 260_shape = TensorShape.Create(ref data, dataLength, lengths); 266_shape = TensorShape.Create(ref data, dataLength, lengths, strides); 272_shape = TensorShape.Create(ref data, dataLength, lengths, strides, linearRankOrder); 279_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);
76 references to _shape
System.Numerics.Tensors (76)
System\Numerics\Tensors\netcore\ReadOnlyTensorDimensionSpan_1.cs (1)
49nint linearOffset = _tensor._shape.GetLinearOffset(index, _dimension);
System\Numerics\Tensors\netcore\ReadOnlyTensorSpan_1.cs (21)
285get => ref Unsafe.Add(ref _reference, _shape.GetLinearOffset<TensorShape.GetOffsetAndLengthForNInt, nint>(indexes)); 291get => ref Unsafe.Add(ref _reference, _shape.GetLinearOffset<TensorShape.GetOffsetAndLengthForNIndex, NIndex>(indexes)); 301public nint FlattenedLength => _shape.FlattenedLength; 304public bool HasAnyDenseDimensions => _shape.HasAnyDenseDimensions; 307public bool IsDense => _shape.IsDense; 310public bool IsEmpty => _shape.IsEmpty; 314public ReadOnlySpan<nint> Lengths => _shape.Lengths; 321public ReadOnlySpan<nint> Strides => _shape.Strides; 330&& left._shape == right._shape; 354items._shape 407if (_shape.FlattenedLength != 0) ret = ref _reference; 414TensorShape shape = _shape.Slice<TensorShape.GetOffsetAndLengthForNInt, nint>(startIndexes, out nint linearOffset); 424TensorShape shape = _shape.Slice<TensorShape.GetOffsetAndLengthForNIndex, NIndex>(startIndexes, out nint linearOffset); 434TensorShape shape = _shape.Slice<TensorShape.GetOffsetAndLengthForNRange, NRange>(ranges, out nint linearOffset); 443public override string ToString() => $"System.Numerics.Tensors.ReadOnlyTensorSpan<{typeof(T).Name}>[{_shape}]"; 448if (TensorShape.AreCompatible(destination._shape, _shape, false)) 459if (_shape.FlattenedLength <= destination.Length) 492if (_itemsEnumerated == _span._shape.FlattenedLength) 497_linearOffset = _span._shape.AdjustToNextIndex(_span._shape, _linearOffset, _indexes);
System\Numerics\Tensors\netcore\Tensor.cs (20)
1634ReadOnlyTensorSpan<T> output = new ReadOnlyTensorSpan<T>(ref tensor._reference, tensor._shape.LinearLength, newLengths, strides); 1691ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref tensor._reference, (int)tensor._shape.LinearLength); 1787&& tensor._shape.LinearLength == other._shape.LinearLength 1789&& MemoryMarshal.CreateReadOnlySpan(in tensor.GetPinnableReference(), (int)tensor._shape.LinearLength).SequenceEqual(MemoryMarshal.CreateReadOnlySpan(in other.GetPinnableReference(), (int)other._shape.LinearLength)); 1799&& tensor._shape.LinearLength == other._shape.LinearLength 1801&& MemoryMarshal.CreateReadOnlySpan(in tensor.GetPinnableReference(), (int)tensor._shape.LinearLength).SequenceEqual(MemoryMarshal.CreateReadOnlySpan(in other.GetPinnableReference(), (int)other._shape.LinearLength)); 1871outputs[i] = new Tensor<T>(values, 0, newShape, [], tensor._shape.LinearRankOrder); 2086strideOrder[index++] = tensor._shape.LinearRankOrder[i]; 2090removed[removedIndex++] = tensor._shape.LinearRankOrder[i]; 2110strideOrder[index++] = tensor._shape.LinearRankOrder[i]; 2114removed = tensor._shape.LinearRankOrder[i]; 2120ReadOnlyTensorSpan<T> output = new ReadOnlyTensorSpan<T>(ref tensor._reference, tensor._shape.LinearLength, lengths[..newRank], strides[..newRank], strideOrder[..newRank]); 2402if (!TensorShape.AreCompatible(destination._shape, tensor._shape, false)) 2516ReadOnlyTensorSpan<T> output = new ReadOnlyTensorSpan<T>(ref tensor._reference, tensor._shape.LinearLength, newLengths, newStrides); 3911ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x._shape.LinearLength); 3923ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x._shape.LinearLength); 3934ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x._shape.LinearLength); 3947ReadOnlySpan<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.CreateUninitialized<TResult>(x._shape.Lengths); 370destination = Tensor.CreateUninitialized<TResult>(y._shape.Lengths);