58 writes to _reference
System.Numerics.Tensors (58)
System\Numerics\Tensors\netcore\Tensor.cs (20)
274if (source._shape.Overlaps(in source._reference, ref destination._reference, destinationLinearLength)) 294alignedTarget = new TensorSpan<T>(ref destination._reference, TensorShape.WithRank(destination._shape, rank)); 337Span<T> dstSpan = MemoryMarshal.CreateSpan(ref target._reference, (int)destinationLength); 467Span<T> span = MemoryMarshal.CreateSpan(ref destination._reference, (int)flattenedLength); 488Span<T> span = MemoryMarshal.CreateSpan(ref slice._reference, (int)slice.FlattenedLength); 527Span<T> span = MemoryMarshal.CreateSpan(ref destination._reference, (int)flattenedLength); 545Span<T> span = MemoryMarshal.CreateSpan(ref slice._reference, (int)slice.FlattenedLength); 1668TensorSpan<T> result = new TensorSpan<T>(ref tensor._reference, tensor._shape.LinearLength, newLengths, strides, tensor.IsPinned); 1723Span<T> ospan = MemoryMarshal.CreateSpan(ref output.AsTensorSpan()._reference, (int)output.FlattenedLength); 1736Span<T> ospan = MemoryMarshal.CreateSpan(ref output.AsTensorSpan()._reference, (int)output.FlattenedLength); 1810Span<T> ospan = MemoryMarshal.CreateSpan(ref destination._reference, (int)destinationLength); 1816TensorOperation.CopyDense(in tensor._reference, ref destination._reference, copyLength); 1820MemoryMarshal.CreateSpan(ref Unsafe.Add(ref destination._reference, offset), length).Clear(); 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)) 1910if (Unsafe.AreSame(ref Unsafe.AsRef(in tensor._reference), ref destination._reference) 1952ref T first = ref Unsafe.Add(ref tensor._reference, leftOffset + i); 1953ref T second = ref Unsafe.Add(ref tensor._reference, rightOffset + i); 2324TensorSpan<T> output = new TensorSpan<T>(ref tensor._reference, tensor._shape.LinearLength, lengths[..rank], strides[..rank], tensor.IsPinned); 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)); 60return new TensorSpan<T>(ref Unsafe.Add(ref _tensor._reference, linearOffset), _sliceShape);
System\Numerics\Tensors\netcore\TensorOperation.cs (11)
28if (!source._shape.Overlaps(in source._reference, ref destination._reference, destination._shape.LinearLength)) 35ref TSource destinationReference = ref Unsafe.As<TDestination, TSource>(ref destination._reference); 57=> MemoryMarshal.CreateSpan(ref destination._reference, checked((int)destination.FlattenedLength)); 304ref Unsafe.Add(ref x._reference, linearOffset) 423ref Unsafe.Add(ref destination._reference, linearOffset), 439ref TArg destinationReference = ref Unsafe.As<TResult, TArg>(ref destination._reference); 496ref Unsafe.Add(ref destination._reference, destinationLinearOffset) 528ref Unsafe.Add(ref destination._reference, destinationLinearOffset) 661ref Unsafe.Add(ref destination._reference, destinationLinearOffset) 749ref Unsafe.Add(ref destination._reference, destinationLinearOffset) 800ref Unsafe.Add(ref destination._reference, destinationLinearOffset)
System\Numerics\Tensors\netcore\TensorSpan_1.cs (24)
39_reference = ref (array is not null) 56_reference = ref (array is not null) 68_reference = ref (array is not null) 78_reference = ref reference; 90_reference = ref reference; 100_reference = ref (array is not null) 112_reference = ref (array is not null) 122_reference = ref Unsafe.AsRef<T>(data); 135_reference = ref Unsafe.AsRef<T>(data); 141_reference = ref data; 146_reference = ref reference; 153get => ref Unsafe.Add(ref _reference, _shape.GetLinearOffset<TensorShape.GetOffsetAndLengthForNInt, nint>(indexes)); 159get => ref Unsafe.Add(ref _reference, _shape.GetLinearOffset<TensorShape.GetOffsetAndLengthForNIndex, NIndex>(indexes)); 197=> Unsafe.AreSame(ref left._reference, ref right._reference) 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; 303ref Unsafe.Add(ref _reference, linearOffset), 313ref Unsafe.Add(ref _reference, linearOffset), 323ref Unsafe.Add(ref _reference, linearOffset), 352span = MemoryMarshal.CreateSpan(ref Unsafe.Add(ref _reference, linearOffset), length); 368span = MemoryMarshal.CreateSpan(ref Unsafe.Add(ref _reference, linearOffset), length); 488return ref Unsafe.Add(ref _span._reference, _linearOffset);
System\Runtime\InteropServices\TensorMarshal.cs (1)
47return ref tensorSpan._reference;