77 references to TensorHelpers
System.Numerics.Tensors (77)
System\Numerics\Tensors\netcore\ReadOnlyTensorSpan.cs (6)
523
if (
TensorHelpers
.IsBroadcastableTo(Lengths, destination.Lengths))
546
nint copyLength = srcSlice.Strides[^1] == 1 &&
TensorHelpers
.IsContiguousAndDense(srcSlice) ? srcSlice.Lengths[^1] : 1;
547
int indexToAdjust = srcSlice.Strides[^1] == 1 &&
TensorHelpers
.IsContiguousAndDense(srcSlice) ? srcSlice.Rank - 2 : srcSlice.Rank - 1;
579
if (
TensorHelpers
.IsBroadcastableTo(Lengths, destination.Lengths))
602
nint copyLength = srcSlice.Strides[^1] == 1 &&
TensorHelpers
.IsContiguousAndDense(srcSlice) ? srcSlice.Lengths[^1] : 1;
603
int indexToAdjust = srcSlice.Strides[^1] == 1 &&
TensorHelpers
.IsContiguousAndDense(srcSlice) ? srcSlice.Rank - 2 : srcSlice.Rank - 1;
System\Numerics\Tensors\netcore\Tensor.cs (1)
355
nint linearLength =
TensorHelpers
.CountTrueElements(filter);
System\Numerics\Tensors\netcore\TensorExtensions.cs (64)
152
if (!
TensorHelpers
.IsBroadcastableTo(input.Lengths, shape))
160
nint[] intermediateShape =
TensorHelpers
.GetIntermediateShape(input.Lengths, shape.Length);
195
if (!
TensorHelpers
.IsBroadcastableTo(input.Lengths, shape))
203
nint[] intermediateShape =
TensorHelpers
.GetIntermediateShape(input.Lengths, shape.Length);
238
if (!
TensorHelpers
.IsBroadcastableTo(input.Lengths, lengths))
246
nint[] intermediateShape =
TensorHelpers
.GetIntermediateShape(input.Lengths, lengths.Length);
389
if (!
TensorHelpers
.AreLengthsTheSame(destination.Lengths, lengths))
458
if (
TensorHelpers
.AreLengthsTheSame(x, y))
485
if (
TensorHelpers
.AreLengthsTheSame(x, y))
487
if (!
TensorHelpers
.AreLengthsTheSame(destination.Lengths, x.Lengths))
495
if (!
TensorHelpers
.AreLengthsTheSame(destination.Lengths, newSize))
554
if (!
TensorHelpers
.AreLengthsTheSame(destination.Lengths, x.Lengths))
826
if (
TensorHelpers
.AreLengthsTheSame(x, y))
856
if (
TensorHelpers
.AreLengthsTheSame(x, y))
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))
1035
if (
TensorHelpers
.AreLengthsTheSame(x, y))
1065
if (
TensorHelpers
.AreLengthsTheSame(x, y))
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))
1738
if (
TensorHelpers
.AreLengthsTheSame(x, y))
1768
if (
TensorHelpers
.AreLengthsTheSame(x, y))
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))
1947
if (
TensorHelpers
.AreLengthsTheSame(x, y))
1977
if (
TensorHelpers
.AreLengthsTheSame(x, y))
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))
2701
TensorHelpers
.PermuteIndices(indexes, permutedIndices, permutation);
2730
if (!
TensorHelpers
.IsContiguousAndDense<T>(tensor) && !tensor.Strides.Contains(0))
2798
if (!
TensorHelpers
.IsContiguousAndDense<T>(tensor) && !tensor.Strides.Contains(0))
2869
if (!
TensorHelpers
.IsContiguousAndDense<T>(tensor) && !tensor.Strides.Contains(0))
3160
if (!
TensorHelpers
.IsBroadcastableTo(values.Lengths, tensor.Lengths))
3167
if (!
TensorHelpers
.IsContiguousAndDense<T>(srcSpan))
3170
if (!
TensorHelpers
.IsBroadcastableTo(values.Lengths, srcSpan.Lengths))
3449
if (!
TensorHelpers
.AreLengthsTheSame<T>(tensors[0], tensors[i]))
3487
if (!
TensorHelpers
.AreLengthsTheSame<T>(tensors[0], tensors[i]))
3638
if (!
TensorHelpers
.IsBroadcastableTo(tensor.Lengths, destination.Lengths))
3642
if (!
TensorHelpers
.AreLengthsTheSame(destination.Lengths, newSize))
6776
if (!
TensorHelpers
.IsBroadcastableTo(shape1, shape2))
6779
nint[] intermediateShape =
TensorHelpers
.GetIntermediateShape(shape1, shape2.Length);
6807
if (
TensorHelpers
.IsContiguousAndDense(input))
6827
if (
TensorHelpers
.IsContiguousAndDense(left) &&
TensorHelpers
.IsContiguousAndDense(right) &&
TensorHelpers
.AreLengthsTheSame(left, right))
6869
if (
TensorHelpers
.IsContiguousAndDense(input) &&
TensorHelpers
.IsContiguousAndDense<TOut>(slicedDestination))
6921
if (
TensorHelpers
.IsContiguousAndDense(input) &&
TensorHelpers
.IsContiguousAndDense<T>(slicedDestination))
6973
if (
TensorHelpers
.IsContiguousAndDense(input) &&
TensorHelpers
.IsContiguousAndDense<T>(slicedDestination))
7021
if (
TensorHelpers
.AreLengthsTheSame(left, right) &&
TensorHelpers
.IsUnderlyingStorageSameSize(left, right) &&
TensorHelpers
.IsContiguousAndDense(left)
7022
&&
TensorHelpers
.IsContiguousAndDense(right) &&
TensorHelpers
.IsContiguousAndDense<T>(slicedDestination))
System\Numerics\Tensors\netcore\TensorSpan.cs (6)
555
if (
TensorHelpers
.IsBroadcastableTo(Lengths, destination.Lengths))
577
nint copyLength = srcSlice.Strides[^1] == 1 &&
TensorHelpers
.IsContiguousAndDense(srcSlice) ? srcSlice.Lengths[^1] : 1;
578
int indexToAdjust = srcSlice.Strides[^1] == 1 &&
TensorHelpers
.IsContiguousAndDense(srcSlice) ? srcSlice.Rank - 2 : srcSlice.Rank - 1;
609
if (
TensorHelpers
.IsBroadcastableTo(Lengths, destination.Lengths))
631
nint copyLength = srcSlice.Strides[^1] == 1 &&
TensorHelpers
.IsContiguousAndDense(srcSlice) ? srcSlice.Lengths[^1] : 1;
632
int indexToAdjust = srcSlice.Strides[^1] == 1 &&
TensorHelpers
.IsContiguousAndDense(srcSlice) ? srcSlice.Rank - 2 : srcSlice.Rank - 1;