77 references to TensorHelpers
System.Numerics.Tensors (77)
System\Numerics\Tensors\netcore\ReadOnlyTensorSpan.cs (6)
540
if (
TensorHelpers
.IsBroadcastableTo(Lengths, destination.Lengths))
563
nint copyLength = srcSlice.Strides[^1] == 1 &&
TensorHelpers
.IsContiguousAndDense(srcSlice) ? srcSlice.Lengths[^1] : 1;
564
int indexToAdjust = srcSlice.Strides[^1] == 1 &&
TensorHelpers
.IsContiguousAndDense(srcSlice) ? srcSlice.Rank - 2 : srcSlice.Rank - 1;
596
if (
TensorHelpers
.IsBroadcastableTo(Lengths, destination.Lengths))
619
nint copyLength = srcSlice.Strides[^1] == 1 &&
TensorHelpers
.IsContiguousAndDense(srcSlice) ? srcSlice.Lengths[^1] : 1;
620
int indexToAdjust = srcSlice.Strides[^1] == 1 &&
TensorHelpers
.IsContiguousAndDense(srcSlice) ? srcSlice.Rank - 2 : srcSlice.Rank - 1;
System\Numerics\Tensors\netcore\Tensor.cs (1)
354
nint linearLength =
TensorHelpers
.CountTrueElements(filter);
System\Numerics\Tensors\netcore\TensorExtensions.cs (64)
137
if (!
TensorHelpers
.IsBroadcastableTo(input.Lengths, shape))
145
nint[] intermediateShape =
TensorHelpers
.GetIntermediateShape(input.Lengths, shape.Length);
180
if (!
TensorHelpers
.IsBroadcastableTo(input.Lengths, shape))
188
nint[] intermediateShape =
TensorHelpers
.GetIntermediateShape(input.Lengths, shape.Length);
223
if (!
TensorHelpers
.IsBroadcastableTo(input.Lengths, lengths))
231
nint[] intermediateShape =
TensorHelpers
.GetIntermediateShape(input.Lengths, lengths.Length);
374
if (!
TensorHelpers
.AreLengthsTheSame(destination.Lengths, lengths))
443
if (
TensorHelpers
.AreLengthsTheSame(x, y))
470
if (
TensorHelpers
.AreLengthsTheSame(x, y))
472
if (!
TensorHelpers
.AreLengthsTheSame(destination.Lengths, x.Lengths))
480
if (!
TensorHelpers
.AreLengthsTheSame(destination.Lengths, newSize))
539
if (!
TensorHelpers
.AreLengthsTheSame(destination.Lengths, x.Lengths))
811
if (
TensorHelpers
.AreLengthsTheSame(x, y))
841
if (
TensorHelpers
.AreLengthsTheSame(x, y))
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))
1020
if (
TensorHelpers
.AreLengthsTheSame(x, y))
1050
if (
TensorHelpers
.AreLengthsTheSame(x, y))
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))
1723
if (
TensorHelpers
.AreLengthsTheSame(x, y))
1753
if (
TensorHelpers
.AreLengthsTheSame(x, y))
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))
1932
if (
TensorHelpers
.AreLengthsTheSame(x, y))
1962
if (
TensorHelpers
.AreLengthsTheSame(x, y))
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))
2692
TensorHelpers
.PermuteIndices(indexes, permutedIndices, permutation);
2721
if (!
TensorHelpers
.IsContiguousAndDense<T>(tensor) && !tensor.Strides.Contains(0))
2789
if (!
TensorHelpers
.IsContiguousAndDense<T>(tensor) && !tensor.Strides.Contains(0))
2860
if (!
TensorHelpers
.IsContiguousAndDense<T>(tensor) && !tensor.Strides.Contains(0))
3151
if (!
TensorHelpers
.IsBroadcastableTo(values.Lengths, tensor.Lengths))
3158
if (!
TensorHelpers
.IsContiguousAndDense<T>(srcSpan))
3161
if (!
TensorHelpers
.IsBroadcastableTo(values.Lengths, srcSpan.Lengths))
3440
if (!
TensorHelpers
.AreLengthsTheSame<T>(tensors[0], tensors[i]))
3478
if (!
TensorHelpers
.AreLengthsTheSame<T>(tensors[0], tensors[i]))
3617
if (!
TensorHelpers
.IsBroadcastableTo(tensor.Lengths, destination.Lengths))
3621
if (!
TensorHelpers
.AreLengthsTheSame(destination.Lengths, newSize))
6833
if (!
TensorHelpers
.IsBroadcastableTo(shape1, shape2))
6836
nint[] intermediateShape =
TensorHelpers
.GetIntermediateShape(shape1, shape2.Length);
6864
if (
TensorHelpers
.IsContiguousAndDense(input))
6884
if (
TensorHelpers
.IsContiguousAndDense(left) &&
TensorHelpers
.IsContiguousAndDense(right) &&
TensorHelpers
.AreLengthsTheSame(left, right))
6926
if (
TensorHelpers
.IsContiguousAndDense(input) &&
TensorHelpers
.IsContiguousAndDense<TOut>(slicedDestination))
6978
if (
TensorHelpers
.IsContiguousAndDense(input) &&
TensorHelpers
.IsContiguousAndDense<T>(slicedDestination))
7030
if (
TensorHelpers
.IsContiguousAndDense(input) &&
TensorHelpers
.IsContiguousAndDense<T>(slicedDestination))
7078
if (
TensorHelpers
.AreLengthsTheSame(left, right) &&
TensorHelpers
.IsUnderlyingStorageSameSize(left, right) &&
TensorHelpers
.IsContiguousAndDense(left)
7079
&&
TensorHelpers
.IsContiguousAndDense(right) &&
TensorHelpers
.IsContiguousAndDense<T>(slicedDestination))
System\Numerics\Tensors\netcore\TensorSpan.cs (6)
570
if (
TensorHelpers
.IsBroadcastableTo(Lengths, destination.Lengths))
592
nint copyLength = srcSlice.Strides[^1] == 1 &&
TensorHelpers
.IsContiguousAndDense(srcSlice) ? srcSlice.Lengths[^1] : 1;
593
int indexToAdjust = srcSlice.Strides[^1] == 1 &&
TensorHelpers
.IsContiguousAndDense(srcSlice) ? srcSlice.Rank - 2 : srcSlice.Rank - 1;
624
if (
TensorHelpers
.IsBroadcastableTo(Lengths, destination.Lengths))
646
nint copyLength = srcSlice.Strides[^1] == 1 &&
TensorHelpers
.IsContiguousAndDense(srcSlice) ? srcSlice.Lengths[^1] : 1;
647
int indexToAdjust = srcSlice.Strides[^1] == 1 &&
TensorHelpers
.IsContiguousAndDense(srcSlice) ? srcSlice.Rank - 2 : srcSlice.Rank - 1;