27 references to Strides
System.Numerics.Tensors (27)
System\Numerics\Tensors\netcore\ReadOnlyTensorSpan.cs (2)
568TensorSpanHelpers.Memmove(ref Unsafe.Add(ref destinationSlice._reference, TensorSpanHelpers.ComputeLinearIndex(curIndexes, destinationSlice.Strides, destinationSlice.Lengths)), ref Unsafe.Add(ref srcSlice._reference, TensorSpanHelpers.ComputeLinearIndex(curIndexes, srcSlice.Strides, srcSlice.Lengths)), copyLength); 624TensorSpanHelpers.Memmove(ref Unsafe.Add(ref destinationSlice._reference, TensorSpanHelpers.ComputeLinearIndex(curIndexes, destinationSlice.Strides, destinationSlice.Lengths)), ref Unsafe.Add(ref srcSlice._reference, TensorSpanHelpers.ComputeLinearIndex(curIndexes, srcSlice.Strides, srcSlice.Lengths)), copyLength);
System\Numerics\Tensors\netcore\TensorExtensions.cs (18)
149return new TensorSpan<T>(ref input._reference, shape, input.Strides, input._shape._memoryLength); 2803if (!TensorHelpers.IsContiguousAndDense<T>(tensor) && !tensor.Strides.Contains(0)) 2833if (tensor.Strides.Contains(0)) 2835List<nint> origStrides = new List<nint>(tensor.Strides.ToArray()); 2846origStrides.Add(tensor.Strides[lengthOffset - 1]); 2848origStrides.Insert(i, tensor.Strides[i] * tensor.Lengths[i]); 3730Span<nint> strides = tensor.Strides.Length + 1 <= TensorShape.MaxInlineRank ? 3731stackalloc nint[tensor.Strides.Length + 1] : 3732new nint[tensor.Strides.Length + 1]; 3735tensor.Strides.CopyTo(strides); 3736strides[dimension] = tensor.Strides[dimension - 1]; 3740tensor.Strides.Slice(0, dimension).CopyTo(strides); 3741tensor.Strides.Slice(dimension).CopyTo(strides.Slice(dimension + 1)); 3742strides[dimension] = tensor.Strides[dimension] * tensor.Lengths[dimension]; 7129ospan = MemoryMarshal.CreateSpan(ref Unsafe.Add(ref slicedDestination._reference, TensorSpanHelpers.ComputeLinearIndex(curIndex, slicedDestination.Strides, slicedDestination.Lengths)), (int)rowLength); 7142ospan = MemoryMarshal.CreateSpan(ref Unsafe.Add(ref slicedDestination._reference, TensorSpanHelpers.ComputeLinearIndex(curIndex, slicedDestination.Strides, slicedDestination.Lengths)), (int)rowLength); 7155ospan = MemoryMarshal.CreateSpan(ref Unsafe.Add(ref slicedDestination._reference, TensorSpanHelpers.ComputeLinearIndex(curIndex, slicedDestination.Strides, slicedDestination.Lengths)), (int)rowLength); 7169ospan = MemoryMarshal.CreateSpan(ref Unsafe.Add(ref slicedDestination._reference, TensorSpanHelpers.ComputeLinearIndex(curIndex, slicedDestination.Strides, slicedDestination.Lengths)), (int)rowLength);
System\Numerics\Tensors\netcore\TensorSpan.cs (7)
333nint index = TensorSpanHelpers.ComputeLinearIndex(indexes, Strides, Lengths); 358nint index = TensorSpanHelpers.ComputeLinearIndex(indexes, Strides, Lengths); 540TensorSpanHelpers.Clear(ref Unsafe.Add(ref _reference, TensorSpanHelpers.ComputeLinearIndex(curIndexes, Strides, Lengths)), (nuint)Lengths[Rank - 1]); 597TensorSpanHelpers.Memmove(ref Unsafe.Add(ref destinationSlice._reference, TensorSpanHelpers.ComputeLinearIndex(curIndexes, destinationSlice.Strides, destinationSlice.Lengths)), ref Unsafe.Add(ref srcSlice._reference, TensorSpanHelpers.ComputeLinearIndex(curIndexes, srcSlice.Strides, srcSlice.Lengths)), copyLength); 651TensorSpanHelpers.Memmove(ref Unsafe.Add(ref destinationSlice._reference, TensorSpanHelpers.ComputeLinearIndex(curIndexes, destinationSlice.Strides, destinationSlice.Lengths)), ref Unsafe.Add(ref srcSlice._reference, TensorSpanHelpers.ComputeLinearIndex(curIndexes, srcSlice.Strides, srcSlice.Lengths)), copyLength); 763index += Strides[i] * (offsets[i]); 824TensorSpanHelpers.Memmove(destination.Slice(checked((int)copiedValues)), ref Unsafe.Add(ref _reference, TensorSpanHelpers.ComputeLinearIndex(curIndexes, Strides, Lengths)), Lengths[Rank - 1]);