84 references to Lengths
System.Numerics.Tensors (84)
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\Tensor.cs (2)
245if (!srcSpan.Lengths.SequenceEqual(value.Lengths)) 466var outTensor = new Tensor<T>(values, s.Lengths.ToArray(), _isPinned);
System\Numerics\Tensors\netcore\TensorExtensions.cs (60)
99nint[] newSize = Tensor.GetSmallestBroadcastableLengths(source.Lengths, destination.Lengths); 100if (!destination.Lengths.SequenceEqual(newSize)) 114nint[] newSize = Tensor.GetSmallestBroadcastableLengths(source.Lengths, destination.Lengths); 115if (!destination.Lengths.SequenceEqual(newSize)) 129nint[] newSize = Tensor.GetSmallestBroadcastableLengths(source.Lengths, destination.Lengths); 130if (!destination.Lengths.SequenceEqual(newSize)) 148if (input.Lengths.SequenceEqual(shape)) 151if (!TensorHelpers.IsBroadcastableTo(input.Lengths, shape)) 159nint[] intermediateShape = TensorHelpers.GetIntermediateShape(input.Lengths, shape.Length); 388if (!TensorHelpers.AreLengthsTheSame(destination.Lengths, lengths)) 486if (!TensorHelpers.AreLengthsTheSame(destination.Lengths, x.Lengths)) 494if (!TensorHelpers.AreLengthsTheSame(destination.Lengths, newSize)) 553if (!TensorHelpers.AreLengthsTheSame(destination.Lengths, x.Lengths)) 762if (filter.Lengths.Length != tensor.Lengths.Length) 788if (filter.Lengths.Length != tensor.Lengths.Length) 857if (!TensorHelpers.AreLengthsTheSame(destination.Lengths, x.Lengths)) 865if (!TensorHelpers.AreLengthsTheSame(destination.Lengths, newSize)) 928if (!TensorHelpers.AreLengthsTheSame(destination.Lengths, x.Lengths)) 988if (!TensorHelpers.AreLengthsTheSame(destination.Lengths, y.Lengths)) 1066if (!TensorHelpers.AreLengthsTheSame(destination.Lengths, x.Lengths)) 1074if (!TensorHelpers.AreLengthsTheSame(destination.Lengths, newSize)) 1137if (!TensorHelpers.AreLengthsTheSame(destination.Lengths, x.Lengths)) 1197if (!TensorHelpers.AreLengthsTheSame(destination.Lengths, y.Lengths)) 1769if (!TensorHelpers.AreLengthsTheSame(destination.Lengths, x.Lengths)) 1777if (!TensorHelpers.AreLengthsTheSame(destination.Lengths, newSize)) 1840if (!TensorHelpers.AreLengthsTheSame(destination.Lengths, x.Lengths)) 1900if (!TensorHelpers.AreLengthsTheSame(destination.Lengths, y.Lengths)) 1978if (!TensorHelpers.AreLengthsTheSame(destination.Lengths, x.Lengths)) 1986if (!TensorHelpers.AreLengthsTheSame(destination.Lengths, newSize)) 2049if (!TensorHelpers.AreLengthsTheSame(destination.Lengths, x.Lengths)) 2109if (!TensorHelpers.AreLengthsTheSame(destination.Lengths, y.Lengths)) 2800if (tensor.Lengths.SequenceEqual(lengths)) 2839if (lengthOffset < tensor.Rank && arrLengths[i] == tensor.Lengths[lengthOffset]) 2848origStrides.Insert(i, tensor.Strides[i] * tensor.Lengths[i]); 3123&& tensor.Lengths.SequenceEqual(other.Lengths) 3165if (!TensorHelpers.IsBroadcastableTo(values.Lengths, tensor.Lengths)) 3175if (!TensorHelpers.IsBroadcastableTo(values.Lengths, srcSpan.Lengths)) 3345for (int i = 0; i < tensor.Lengths.Length; i++) 3347if (tensor.Lengths[i] != 1) 3349tempLengths.Add(tensor.Lengths[i]); 3357if (tensor.Lengths[dimension] != 1) 3361for (int i = 0; i < tensor.Lengths.Length; i++) 3365tempLengths.Add(tensor.Lengths[i]); 3661if (!TensorHelpers.IsBroadcastableTo(tensor.Lengths, destination.Lengths)) 3664nint[] newSize = Tensor.GetSmallestBroadcastableLengths(tensor.Lengths, destination.Lengths); 3665if (!TensorHelpers.AreLengthsTheSame(destination.Lengths, newSize)) 3718if (dimension > tensor.Lengths.Length) 3723Span<nint> lengths = tensor.Lengths.Length + 1 <= TensorShape.MaxInlineRank ? 3724stackalloc nint[tensor.Lengths.Length + 1] : 3725new nint[tensor.Lengths.Length + 1]; 3726tensor.Lengths.Slice(0, dimension).CopyTo(lengths); 3727tensor.Lengths.Slice(dimension).CopyTo(lengths.Slice(dimension + 1)); 3742strides[dimension] = tensor.Strides[dimension] * tensor.Lengths[dimension]; 4702if (destination.Lengths[0] != dim1 || destination.Lengths[1] != dim2) 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 (20)
333nint index = TensorSpanHelpers.ComputeLinearIndex(indexes, Strides, Lengths); 358nint index = TensorSpanHelpers.ComputeLinearIndex(indexes, Strides, Lengths); 407public int Rank => Lengths.Length; 488TensorSpanHelpers.AdjustIndexes(_span.Rank - 1, 1, _curIndexes, _span.Lengths); 540TensorSpanHelpers.Clear(ref Unsafe.Add(ref _reference, TensorSpanHelpers.ComputeLinearIndex(curIndexes, Strides, Lengths)), (nuint)Lengths[Rank - 1]); 542clearedValues += Lengths[Rank - 1]; 570if (TensorHelpers.IsBroadcastableTo(Lengths, destination.Lengths)) 588nint[] tempLengths = Tensor.GetSmallestBroadcastableLengths(Lengths, destination.Lengths); 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); 624if (TensorHelpers.IsBroadcastableTo(Lengths, destination.Lengths)) 642nint[] tempLengths = Tensor.GetSmallestBroadcastableLengths(Lengths, destination.Lengths); 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); 694ranges[i] = new NRange(checked((int)indexes[i].GetOffset(Lengths[i])), Lengths[i]); 722if (ranges.Length != Lengths.Length) 751(offsets[i], lengths[i]) = ranges[i].GetOffsetAndLength(Lengths[i]); 824TensorSpanHelpers.Memmove(destination.Slice(checked((int)copiedValues)), ref Unsafe.Add(ref _reference, TensorSpanHelpers.ComputeLinearIndex(curIndexes, Strides, Lengths)), Lengths[Rank - 1]); 826copiedValues += Lengths[Rank - 1];