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)
151
if (!
TensorHelpers
.IsBroadcastableTo(input.Lengths, shape))
159
nint[] intermediateShape =
TensorHelpers
.GetIntermediateShape(input.Lengths, shape.Length);
194
if (!
TensorHelpers
.IsBroadcastableTo(input.Lengths, shape))
202
nint[] intermediateShape =
TensorHelpers
.GetIntermediateShape(input.Lengths, shape.Length);
237
if (!
TensorHelpers
.IsBroadcastableTo(input.Lengths, lengths))
245
nint[] intermediateShape =
TensorHelpers
.GetIntermediateShape(input.Lengths, lengths.Length);
388
if (!
TensorHelpers
.AreLengthsTheSame(destination.Lengths, lengths))
457
if (
TensorHelpers
.AreLengthsTheSame(x, y))
484
if (
TensorHelpers
.AreLengthsTheSame(x, y))
486
if (!
TensorHelpers
.AreLengthsTheSame(destination.Lengths, x.Lengths))
494
if (!
TensorHelpers
.AreLengthsTheSame(destination.Lengths, newSize))
553
if (!
TensorHelpers
.AreLengthsTheSame(destination.Lengths, x.Lengths))
825
if (
TensorHelpers
.AreLengthsTheSame(x, y))
855
if (
TensorHelpers
.AreLengthsTheSame(x, y))
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))
1034
if (
TensorHelpers
.AreLengthsTheSame(x, y))
1064
if (
TensorHelpers
.AreLengthsTheSame(x, y))
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))
1737
if (
TensorHelpers
.AreLengthsTheSame(x, y))
1767
if (
TensorHelpers
.AreLengthsTheSame(x, y))
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))
1946
if (
TensorHelpers
.AreLengthsTheSame(x, y))
1976
if (
TensorHelpers
.AreLengthsTheSame(x, y))
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))
2706
TensorHelpers
.PermuteIndices(indexes, permutedIndices, permutation);
2735
if (!
TensorHelpers
.IsContiguousAndDense<T>(tensor) && !tensor.Strides.Contains(0))
2803
if (!
TensorHelpers
.IsContiguousAndDense<T>(tensor) && !tensor.Strides.Contains(0))
2874
if (!
TensorHelpers
.IsContiguousAndDense<T>(tensor) && !tensor.Strides.Contains(0))
3165
if (!
TensorHelpers
.IsBroadcastableTo(values.Lengths, tensor.Lengths))
3172
if (!
TensorHelpers
.IsContiguousAndDense<T>(srcSpan))
3175
if (!
TensorHelpers
.IsBroadcastableTo(values.Lengths, srcSpan.Lengths))
3454
if (!
TensorHelpers
.AreLengthsTheSame<T>(tensors[0], tensors[i]))
3492
if (!
TensorHelpers
.AreLengthsTheSame<T>(tensors[0], tensors[i]))
3650
if (!
TensorHelpers
.IsBroadcastableTo(tensor.Lengths, destination.Lengths))
3654
if (!
TensorHelpers
.AreLengthsTheSame(destination.Lengths, newSize))
6840
if (!
TensorHelpers
.IsBroadcastableTo(shape1, shape2))
6843
nint[] intermediateShape =
TensorHelpers
.GetIntermediateShape(shape1, shape2.Length);
6871
if (
TensorHelpers
.IsContiguousAndDense(input))
6891
if (
TensorHelpers
.IsContiguousAndDense(left) &&
TensorHelpers
.IsContiguousAndDense(right) &&
TensorHelpers
.AreLengthsTheSame(left, right))
6933
if (
TensorHelpers
.IsContiguousAndDense(input) &&
TensorHelpers
.IsContiguousAndDense<TOut>(slicedDestination))
6985
if (
TensorHelpers
.IsContiguousAndDense(input) &&
TensorHelpers
.IsContiguousAndDense<T>(slicedDestination))
7037
if (
TensorHelpers
.IsContiguousAndDense(input) &&
TensorHelpers
.IsContiguousAndDense<T>(slicedDestination))
7085
if (
TensorHelpers
.AreLengthsTheSame(left, right) &&
TensorHelpers
.IsUnderlyingStorageSameSize(left, right) &&
TensorHelpers
.IsContiguousAndDense(left)
7086
&&
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;