84 references to Lengths
System.Numerics.Tensors (84)
System\Numerics\Tensors\netcore\ReadOnlyTensorSpan.cs (2)
568
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);
624
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)
245
if (!srcSpan.
Lengths
.SequenceEqual(value.Lengths))
466
var outTensor = new Tensor<T>(values, s.
Lengths
.ToArray(), _isPinned);
System\Numerics\Tensors\netcore\TensorExtensions.cs (60)
85
nint[] newSize = Tensor.GetSmallestBroadcastableLengths(source.Lengths, destination.
Lengths
);
86
if (!destination.
Lengths
.SequenceEqual(newSize))
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))
134
if (input.
Lengths
.SequenceEqual(shape))
137
if (!TensorHelpers.IsBroadcastableTo(input.
Lengths
, shape))
145
nint[] intermediateShape = TensorHelpers.GetIntermediateShape(input.
Lengths
, shape.Length);
374
if (!TensorHelpers.AreLengthsTheSame(destination.
Lengths
, lengths))
472
if (!TensorHelpers.AreLengthsTheSame(destination.
Lengths
, x.Lengths))
480
if (!TensorHelpers.AreLengthsTheSame(destination.
Lengths
, newSize))
539
if (!TensorHelpers.AreLengthsTheSame(destination.
Lengths
, x.Lengths))
748
if (filter.Lengths.Length != tensor.
Lengths
.Length)
774
if (filter.Lengths.Length != tensor.
Lengths
.Length)
843
if (!TensorHelpers.AreLengthsTheSame(destination.
Lengths
, x.Lengths))
851
if (!TensorHelpers.AreLengthsTheSame(destination.
Lengths
, newSize))
914
if (!TensorHelpers.AreLengthsTheSame(destination.
Lengths
, x.Lengths))
974
if (!TensorHelpers.AreLengthsTheSame(destination.
Lengths
, y.Lengths))
1052
if (!TensorHelpers.AreLengthsTheSame(destination.
Lengths
, x.Lengths))
1060
if (!TensorHelpers.AreLengthsTheSame(destination.
Lengths
, newSize))
1123
if (!TensorHelpers.AreLengthsTheSame(destination.
Lengths
, x.Lengths))
1183
if (!TensorHelpers.AreLengthsTheSame(destination.
Lengths
, y.Lengths))
1755
if (!TensorHelpers.AreLengthsTheSame(destination.
Lengths
, x.Lengths))
1763
if (!TensorHelpers.AreLengthsTheSame(destination.
Lengths
, newSize))
1826
if (!TensorHelpers.AreLengthsTheSame(destination.
Lengths
, x.Lengths))
1886
if (!TensorHelpers.AreLengthsTheSame(destination.
Lengths
, y.Lengths))
1964
if (!TensorHelpers.AreLengthsTheSame(destination.
Lengths
, x.Lengths))
1972
if (!TensorHelpers.AreLengthsTheSame(destination.
Lengths
, newSize))
2035
if (!TensorHelpers.AreLengthsTheSame(destination.
Lengths
, x.Lengths))
2095
if (!TensorHelpers.AreLengthsTheSame(destination.
Lengths
, y.Lengths))
2786
if (tensor.
Lengths
.SequenceEqual(lengths))
2825
if (lengthOffset < tensor.Rank && arrLengths[i] == tensor.
Lengths
[lengthOffset])
2834
origStrides.Insert(i, tensor.Strides[i] * tensor.
Lengths
[i]);
3109
&& tensor.
Lengths
.SequenceEqual(other.Lengths)
3151
if (!TensorHelpers.IsBroadcastableTo(values.Lengths, tensor.
Lengths
))
3161
if (!TensorHelpers.IsBroadcastableTo(values.Lengths, srcSpan.
Lengths
))
3331
for (int i = 0; i < tensor.
Lengths
.Length; i++)
3333
if (tensor.
Lengths
[i] != 1)
3335
tempLengths.Add(tensor.
Lengths
[i]);
3343
if (tensor.
Lengths
[dimension] != 1)
3347
for (int i = 0; i < tensor.
Lengths
.Length; i++)
3351
tempLengths.Add(tensor.
Lengths
[i]);
3617
if (!TensorHelpers.IsBroadcastableTo(tensor.Lengths, destination.
Lengths
))
3620
nint[] newSize = Tensor.GetSmallestBroadcastableLengths(tensor.Lengths, destination.
Lengths
);
3621
if (!TensorHelpers.AreLengthsTheSame(destination.
Lengths
, newSize))
3674
if (dimension > tensor.
Lengths
.Length)
3679
Span<nint> lengths = tensor.
Lengths
.Length + 1 <= TensorShape.MaxInlineRank ?
3680
stackalloc nint[tensor.
Lengths
.Length + 1] :
3681
new nint[tensor.
Lengths
.Length + 1];
3682
tensor.
Lengths
.Slice(0, dimension).CopyTo(lengths);
3683
tensor.
Lengths
.Slice(dimension).CopyTo(lengths.Slice(dimension + 1));
3698
strides[dimension] = tensor.Strides[dimension] * tensor.
Lengths
[dimension];
4671
if (destination.
Lengths
[0] != dim1 || destination.
Lengths
[1] != dim2)
7124
ospan = MemoryMarshal.CreateSpan(ref Unsafe.Add(ref slicedDestination._reference, TensorSpanHelpers.ComputeLinearIndex(curIndex, slicedDestination.Strides, slicedDestination.
Lengths
)), (int)rowLength);
7137
ospan = MemoryMarshal.CreateSpan(ref Unsafe.Add(ref slicedDestination._reference, TensorSpanHelpers.ComputeLinearIndex(curIndex, slicedDestination.Strides, slicedDestination.
Lengths
)), (int)rowLength);
7150
ospan = MemoryMarshal.CreateSpan(ref Unsafe.Add(ref slicedDestination._reference, TensorSpanHelpers.ComputeLinearIndex(curIndex, slicedDestination.Strides, slicedDestination.
Lengths
)), (int)rowLength);
7164
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)
333
nint index = TensorSpanHelpers.ComputeLinearIndex(indexes, Strides,
Lengths
);
358
nint index = TensorSpanHelpers.ComputeLinearIndex(indexes, Strides,
Lengths
);
407
public int Rank =>
Lengths
.Length;
488
TensorSpanHelpers.AdjustIndexes(_span.Rank - 1, 1, _curIndexes, _span.
Lengths
);
540
TensorSpanHelpers.Clear(ref Unsafe.Add(ref _reference, TensorSpanHelpers.ComputeLinearIndex(curIndexes, Strides,
Lengths
)), (nuint)
Lengths
[Rank - 1]);
542
clearedValues +=
Lengths
[Rank - 1];
570
if (TensorHelpers.IsBroadcastableTo(
Lengths
, destination.Lengths))
588
nint[] tempLengths = Tensor.GetSmallestBroadcastableLengths(
Lengths
, destination.Lengths);
597
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);
624
if (TensorHelpers.IsBroadcastableTo(
Lengths
, destination.Lengths))
642
nint[] tempLengths = Tensor.GetSmallestBroadcastableLengths(
Lengths
, destination.Lengths);
651
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);
694
ranges[i] = new NRange(checked((int)indexes[i].GetOffset(
Lengths
[i])),
Lengths
[i]);
722
if (ranges.Length !=
Lengths
.Length)
751
(offsets[i], lengths[i]) = ranges[i].GetOffsetAndLength(
Lengths
[i]);
824
TensorSpanHelpers.Memmove(destination.Slice(checked((int)copiedValues)), ref Unsafe.Add(ref _reference, TensorSpanHelpers.ComputeLinearIndex(curIndexes, Strides,
Lengths
)),
Lengths
[Rank - 1]);
826
copiedValues +=
Lengths
[Rank - 1];