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