80 references to Lengths
System.Numerics.Tensors (80)
System\Numerics\Tensors\netcore\ReadOnlyTensorSpan.cs (2)
551TensorSpanHelpers.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); 607TensorSpanHelpers.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)
246if (!srcSpan.Lengths.SequenceEqual(value.Lengths)) 467var outTensor = new Tensor<T>(values, s.Lengths.ToArray(), _isPinned);
System\Numerics\Tensors\netcore\TensorExtensions.cs (56)
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)) 130nint[] newSize = Tensor.GetSmallestBroadcastableLengths(source.Lengths, destination.Lengths); 131if (!destination.Lengths.SequenceEqual(newSize)) 149if (input.Lengths.SequenceEqual(shape)) 152if (!TensorHelpers.IsBroadcastableTo(input.Lengths, shape)) 160nint[] intermediateShape = TensorHelpers.GetIntermediateShape(input.Lengths, shape.Length); 389if (!TensorHelpers.AreLengthsTheSame(destination.Lengths, lengths)) 487if (!TensorHelpers.AreLengthsTheSame(destination.Lengths, x.Lengths)) 495if (!TensorHelpers.AreLengthsTheSame(destination.Lengths, newSize)) 554if (!TensorHelpers.AreLengthsTheSame(destination.Lengths, x.Lengths)) 763if (filter.Lengths.Length != tensor.Lengths.Length) 789if (filter.Lengths.Length != tensor.Lengths.Length) 858if (!TensorHelpers.AreLengthsTheSame(destination.Lengths, x.Lengths)) 866if (!TensorHelpers.AreLengthsTheSame(destination.Lengths, newSize)) 929if (!TensorHelpers.AreLengthsTheSame(destination.Lengths, x.Lengths)) 989if (!TensorHelpers.AreLengthsTheSame(destination.Lengths, y.Lengths)) 1067if (!TensorHelpers.AreLengthsTheSame(destination.Lengths, x.Lengths)) 1075if (!TensorHelpers.AreLengthsTheSame(destination.Lengths, newSize)) 1138if (!TensorHelpers.AreLengthsTheSame(destination.Lengths, x.Lengths)) 1198if (!TensorHelpers.AreLengthsTheSame(destination.Lengths, y.Lengths)) 1770if (!TensorHelpers.AreLengthsTheSame(destination.Lengths, x.Lengths)) 1778if (!TensorHelpers.AreLengthsTheSame(destination.Lengths, newSize)) 1841if (!TensorHelpers.AreLengthsTheSame(destination.Lengths, x.Lengths)) 1901if (!TensorHelpers.AreLengthsTheSame(destination.Lengths, y.Lengths)) 1979if (!TensorHelpers.AreLengthsTheSame(destination.Lengths, x.Lengths)) 1987if (!TensorHelpers.AreLengthsTheSame(destination.Lengths, newSize)) 2050if (!TensorHelpers.AreLengthsTheSame(destination.Lengths, x.Lengths)) 2110if (!TensorHelpers.AreLengthsTheSame(destination.Lengths, y.Lengths)) 2795if (tensor.Lengths.SequenceEqual(lengths)) 2834if (lengthOffset < tensor.Rank && arrLengths[i] == tensor.Lengths[lengthOffset]) 2843origStrides.Insert(i, tensor.Strides[i] * tensor.Lengths[i]); 3118&& tensor.Lengths.SequenceEqual(other.Lengths) 3160if (!TensorHelpers.IsBroadcastableTo(values.Lengths, tensor.Lengths)) 3170if (!TensorHelpers.IsBroadcastableTo(values.Lengths, srcSpan.Lengths)) 3340for (int i = 0; i < tensor.Lengths.Length; i++) 3342if (tensor.Lengths[i] != 1) 3344tempLengths.Add(tensor.Lengths[i]); 3352if (tensor.Lengths[dimension] != 1) 3356for (int i = 0; i < tensor.Lengths.Length; i++) 3360tempLengths.Add(tensor.Lengths[i]); 3638if (!TensorHelpers.IsBroadcastableTo(tensor.Lengths, destination.Lengths)) 3641nint[] newSize = Tensor.GetSmallestBroadcastableLengths(tensor.Lengths, destination.Lengths); 3642if (!TensorHelpers.AreLengthsTheSame(destination.Lengths, newSize)) 3682if (dimension > tensor.Lengths.Length) 3687List<nint> tempLengths = tensor.Lengths.ToArray().ToList(); 3694tempStrides.Insert(dimension, tensor.Strides[dimension] * tensor.Lengths[dimension]); 4640if (destination.Lengths[0] != dim1 || destination.Lengths[1] != dim2) 7067ospan = MemoryMarshal.CreateSpan(ref Unsafe.Add(ref slicedDestination._reference, TensorSpanHelpers.ComputeLinearIndex(curIndex, slicedDestination.Strides, slicedDestination.Lengths)), (int)rowLength); 7080ospan = MemoryMarshal.CreateSpan(ref Unsafe.Add(ref slicedDestination._reference, TensorSpanHelpers.ComputeLinearIndex(curIndex, slicedDestination.Strides, slicedDestination.Lengths)), (int)rowLength); 7093ospan = MemoryMarshal.CreateSpan(ref Unsafe.Add(ref slicedDestination._reference, TensorSpanHelpers.ComputeLinearIndex(curIndex, slicedDestination.Strides, slicedDestination.Lengths)), (int)rowLength); 7107ospan = MemoryMarshal.CreateSpan(ref Unsafe.Add(ref slicedDestination._reference, TensorSpanHelpers.ComputeLinearIndex(curIndex, slicedDestination.Strides, slicedDestination.Lengths)), (int)rowLength);
System\Numerics\Tensors\netcore\TensorSpan.cs (20)
318nint index = TensorSpanHelpers.ComputeLinearIndex(indexes, Strides, Lengths); 343nint index = TensorSpanHelpers.ComputeLinearIndex(indexes, Strides, Lengths); 392public int Rank => Lengths.Length; 473TensorSpanHelpers.AdjustIndexes(_span.Rank - 1, 1, _curIndexes, _span.Lengths); 525TensorSpanHelpers.Clear(ref Unsafe.Add(ref _reference, TensorSpanHelpers.ComputeLinearIndex(curIndexes, Strides, Lengths)), (nuint)Lengths[Rank - 1]); 527clearedValues += Lengths[Rank - 1]; 555if (TensorHelpers.IsBroadcastableTo(Lengths, destination.Lengths)) 573nint[] tempLengths = Tensor.GetSmallestBroadcastableLengths(Lengths, destination.Lengths); 582TensorSpanHelpers.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); 609if (TensorHelpers.IsBroadcastableTo(Lengths, destination.Lengths)) 627nint[] tempLengths = Tensor.GetSmallestBroadcastableLengths(Lengths, destination.Lengths); 636TensorSpanHelpers.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); 679ranges[i] = new NRange(checked((int)indexes[i].GetOffset(Lengths[i])), Lengths[i]); 707if (ranges.Length != Lengths.Length) 736(offsets[i], lengths[i]) = ranges[i].GetOffsetAndLength(Lengths[i]); 809TensorSpanHelpers.Memmove(destination.Slice(checked((int)copiedValues)), ref Unsafe.Add(ref _reference, TensorSpanHelpers.ComputeLinearIndex(curIndexes, Strides, Lengths)), Lengths[Rank - 1]); 811copiedValues += Lengths[Rank - 1];