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)
85nint[] newSize = Tensor.GetSmallestBroadcastableLengths(source.Lengths, destination.Lengths); 86if (!destination.Lengths.SequenceEqual(newSize)) 100nint[] newSize = Tensor.GetSmallestBroadcastableLengths(source.Lengths, destination.Lengths); 101if (!destination.Lengths.SequenceEqual(newSize)) 115nint[] newSize = Tensor.GetSmallestBroadcastableLengths(source.Lengths, destination.Lengths); 116if (!destination.Lengths.SequenceEqual(newSize)) 134if (input.Lengths.SequenceEqual(shape)) 137if (!TensorHelpers.IsBroadcastableTo(input.Lengths, shape)) 145nint[] intermediateShape = TensorHelpers.GetIntermediateShape(input.Lengths, shape.Length); 374if (!TensorHelpers.AreLengthsTheSame(destination.Lengths, lengths)) 472if (!TensorHelpers.AreLengthsTheSame(destination.Lengths, x.Lengths)) 480if (!TensorHelpers.AreLengthsTheSame(destination.Lengths, newSize)) 539if (!TensorHelpers.AreLengthsTheSame(destination.Lengths, x.Lengths)) 748if (filter.Lengths.Length != tensor.Lengths.Length) 774if (filter.Lengths.Length != tensor.Lengths.Length) 843if (!TensorHelpers.AreLengthsTheSame(destination.Lengths, x.Lengths)) 851if (!TensorHelpers.AreLengthsTheSame(destination.Lengths, newSize)) 914if (!TensorHelpers.AreLengthsTheSame(destination.Lengths, x.Lengths)) 974if (!TensorHelpers.AreLengthsTheSame(destination.Lengths, y.Lengths)) 1052if (!TensorHelpers.AreLengthsTheSame(destination.Lengths, x.Lengths)) 1060if (!TensorHelpers.AreLengthsTheSame(destination.Lengths, newSize)) 1123if (!TensorHelpers.AreLengthsTheSame(destination.Lengths, x.Lengths)) 1183if (!TensorHelpers.AreLengthsTheSame(destination.Lengths, y.Lengths)) 1755if (!TensorHelpers.AreLengthsTheSame(destination.Lengths, x.Lengths)) 1763if (!TensorHelpers.AreLengthsTheSame(destination.Lengths, newSize)) 1826if (!TensorHelpers.AreLengthsTheSame(destination.Lengths, x.Lengths)) 1886if (!TensorHelpers.AreLengthsTheSame(destination.Lengths, y.Lengths)) 1964if (!TensorHelpers.AreLengthsTheSame(destination.Lengths, x.Lengths)) 1972if (!TensorHelpers.AreLengthsTheSame(destination.Lengths, newSize)) 2035if (!TensorHelpers.AreLengthsTheSame(destination.Lengths, x.Lengths)) 2095if (!TensorHelpers.AreLengthsTheSame(destination.Lengths, y.Lengths)) 2786if (tensor.Lengths.SequenceEqual(lengths)) 2825if (lengthOffset < tensor.Rank && arrLengths[i] == tensor.Lengths[lengthOffset]) 2834origStrides.Insert(i, tensor.Strides[i] * tensor.Lengths[i]); 3109&& tensor.Lengths.SequenceEqual(other.Lengths) 3151if (!TensorHelpers.IsBroadcastableTo(values.Lengths, tensor.Lengths)) 3161if (!TensorHelpers.IsBroadcastableTo(values.Lengths, srcSpan.Lengths)) 3331for (int i = 0; i < tensor.Lengths.Length; i++) 3333if (tensor.Lengths[i] != 1) 3335tempLengths.Add(tensor.Lengths[i]); 3343if (tensor.Lengths[dimension] != 1) 3347for (int i = 0; i < tensor.Lengths.Length; i++) 3351tempLengths.Add(tensor.Lengths[i]); 3617if (!TensorHelpers.IsBroadcastableTo(tensor.Lengths, destination.Lengths)) 3620nint[] newSize = Tensor.GetSmallestBroadcastableLengths(tensor.Lengths, destination.Lengths); 3621if (!TensorHelpers.AreLengthsTheSame(destination.Lengths, newSize)) 3674if (dimension > tensor.Lengths.Length) 3679Span<nint> lengths = tensor.Lengths.Length + 1 <= TensorShape.MaxInlineRank ? 3680stackalloc nint[tensor.Lengths.Length + 1] : 3681new nint[tensor.Lengths.Length + 1]; 3682tensor.Lengths.Slice(0, dimension).CopyTo(lengths); 3683tensor.Lengths.Slice(dimension).CopyTo(lengths.Slice(dimension + 1)); 3698strides[dimension] = tensor.Strides[dimension] * tensor.Lengths[dimension]; 4671if (destination.Lengths[0] != dim1 || destination.Lengths[1] != dim2) 7124ospan = MemoryMarshal.CreateSpan(ref Unsafe.Add(ref slicedDestination._reference, TensorSpanHelpers.ComputeLinearIndex(curIndex, slicedDestination.Strides, slicedDestination.Lengths)), (int)rowLength); 7137ospan = MemoryMarshal.CreateSpan(ref Unsafe.Add(ref slicedDestination._reference, TensorSpanHelpers.ComputeLinearIndex(curIndex, slicedDestination.Strides, slicedDestination.Lengths)), (int)rowLength); 7150ospan = MemoryMarshal.CreateSpan(ref Unsafe.Add(ref slicedDestination._reference, TensorSpanHelpers.ComputeLinearIndex(curIndex, slicedDestination.Strides, slicedDestination.Lengths)), (int)rowLength); 7164ospan = 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];