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)
99
nint[] newSize = Tensor.GetSmallestBroadcastableLengths(source.Lengths, destination.
Lengths
);
100
if (!destination.
Lengths
.SequenceEqual(newSize))
114
nint[] newSize = Tensor.GetSmallestBroadcastableLengths(source.
Lengths
, destination.
Lengths
);
115
if (!destination.
Lengths
.SequenceEqual(newSize))
129
nint[] newSize = Tensor.GetSmallestBroadcastableLengths(source.Lengths, destination.
Lengths
);
130
if (!destination.
Lengths
.SequenceEqual(newSize))
148
if (input.
Lengths
.SequenceEqual(shape))
151
if (!TensorHelpers.IsBroadcastableTo(input.
Lengths
, shape))
159
nint[] intermediateShape = TensorHelpers.GetIntermediateShape(input.
Lengths
, shape.Length);
388
if (!TensorHelpers.AreLengthsTheSame(destination.
Lengths
, lengths))
486
if (!TensorHelpers.AreLengthsTheSame(destination.
Lengths
, x.Lengths))
494
if (!TensorHelpers.AreLengthsTheSame(destination.
Lengths
, newSize))
553
if (!TensorHelpers.AreLengthsTheSame(destination.
Lengths
, x.Lengths))
762
if (filter.Lengths.Length != tensor.
Lengths
.Length)
788
if (filter.Lengths.Length != tensor.
Lengths
.Length)
857
if (!TensorHelpers.AreLengthsTheSame(destination.
Lengths
, x.Lengths))
865
if (!TensorHelpers.AreLengthsTheSame(destination.
Lengths
, newSize))
928
if (!TensorHelpers.AreLengthsTheSame(destination.
Lengths
, x.Lengths))
988
if (!TensorHelpers.AreLengthsTheSame(destination.
Lengths
, y.Lengths))
1066
if (!TensorHelpers.AreLengthsTheSame(destination.
Lengths
, x.Lengths))
1074
if (!TensorHelpers.AreLengthsTheSame(destination.
Lengths
, newSize))
1137
if (!TensorHelpers.AreLengthsTheSame(destination.
Lengths
, x.Lengths))
1197
if (!TensorHelpers.AreLengthsTheSame(destination.
Lengths
, y.Lengths))
1769
if (!TensorHelpers.AreLengthsTheSame(destination.
Lengths
, x.Lengths))
1777
if (!TensorHelpers.AreLengthsTheSame(destination.
Lengths
, newSize))
1840
if (!TensorHelpers.AreLengthsTheSame(destination.
Lengths
, x.Lengths))
1900
if (!TensorHelpers.AreLengthsTheSame(destination.
Lengths
, y.Lengths))
1978
if (!TensorHelpers.AreLengthsTheSame(destination.
Lengths
, x.Lengths))
1986
if (!TensorHelpers.AreLengthsTheSame(destination.
Lengths
, newSize))
2049
if (!TensorHelpers.AreLengthsTheSame(destination.
Lengths
, x.Lengths))
2109
if (!TensorHelpers.AreLengthsTheSame(destination.
Lengths
, y.Lengths))
2800
if (tensor.
Lengths
.SequenceEqual(lengths))
2839
if (lengthOffset < tensor.Rank && arrLengths[i] == tensor.
Lengths
[lengthOffset])
2848
origStrides.Insert(i, tensor.Strides[i] * tensor.
Lengths
[i]);
3123
&& tensor.
Lengths
.SequenceEqual(other.Lengths)
3165
if (!TensorHelpers.IsBroadcastableTo(values.Lengths, tensor.
Lengths
))
3175
if (!TensorHelpers.IsBroadcastableTo(values.Lengths, srcSpan.
Lengths
))
3345
for (int i = 0; i < tensor.
Lengths
.Length; i++)
3347
if (tensor.
Lengths
[i] != 1)
3349
tempLengths.Add(tensor.
Lengths
[i]);
3357
if (tensor.
Lengths
[dimension] != 1)
3361
for (int i = 0; i < tensor.
Lengths
.Length; i++)
3365
tempLengths.Add(tensor.
Lengths
[i]);
3661
if (!TensorHelpers.IsBroadcastableTo(tensor.Lengths, destination.
Lengths
))
3664
nint[] newSize = Tensor.GetSmallestBroadcastableLengths(tensor.Lengths, destination.
Lengths
);
3665
if (!TensorHelpers.AreLengthsTheSame(destination.
Lengths
, newSize))
3718
if (dimension > tensor.
Lengths
.Length)
3723
Span<nint> lengths = tensor.
Lengths
.Length + 1 <= TensorShape.MaxInlineRank ?
3724
stackalloc nint[tensor.
Lengths
.Length + 1] :
3725
new nint[tensor.
Lengths
.Length + 1];
3726
tensor.
Lengths
.Slice(0, dimension).CopyTo(lengths);
3727
tensor.
Lengths
.Slice(dimension).CopyTo(lengths.Slice(dimension + 1));
3742
strides[dimension] = tensor.Strides[dimension] * tensor.
Lengths
[dimension];
4702
if (destination.
Lengths
[0] != dim1 || destination.
Lengths
[1] != dim2)
7129
ospan = MemoryMarshal.CreateSpan(ref Unsafe.Add(ref slicedDestination._reference, TensorSpanHelpers.ComputeLinearIndex(curIndex, slicedDestination.Strides, slicedDestination.
Lengths
)), (int)rowLength);
7142
ospan = MemoryMarshal.CreateSpan(ref Unsafe.Add(ref slicedDestination._reference, TensorSpanHelpers.ComputeLinearIndex(curIndex, slicedDestination.Strides, slicedDestination.
Lengths
)), (int)rowLength);
7155
ospan = MemoryMarshal.CreateSpan(ref Unsafe.Add(ref slicedDestination._reference, TensorSpanHelpers.ComputeLinearIndex(curIndex, slicedDestination.Strides, slicedDestination.
Lengths
)), (int)rowLength);
7169
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];