17 instantiations of Tensor
System.Numerics.Tensors (17)
System\Numerics\Tensors\netcore\Tensor.cs (13)
298
=> new
Tensor
<T>(lengths, strides: [], pinned);
303
=> new
Tensor
<T>(lengths, strides, pinned);
308
=> new
Tensor
<T>(array);
313
=> new
Tensor
<T>(array, lengths, strides: []);
318
=> new
Tensor
<T>(array, lengths, strides);
323
=> new
Tensor
<T>(array, start, lengths, strides);
423
return new
Tensor
<T>(values, in shape);
1392
outTensor = new
Tensor
<T>(tensor._values, tensor._start, newLengths, newStrides);
1473
return new
Tensor
<T>(tensor._values, tensor._start, lengths, strides);
1860
outputs[i] = new
Tensor
<T>(values, newLengths, strides: []);
1931
Tensor<T> output = new
Tensor
<T>(tensor._values, tensor._start, lengths[..rank], strides[..rank]);
2273
Tensor<T> output = new
Tensor
<T>(tensor._values, tensor._start, lengths, strides);
2354
Tensor<T> output = new
Tensor
<T>(tensor._values, tensor._start, newLengths, newStrides);
System\Numerics\Tensors\netcore\Tensor_1.cs (4)
21
public static Tensor<T> Empty { get; } =
new
();
216
return new
Tensor
<T>(
231
return new
Tensor
<T>(
246
return new
Tensor
<T>(
484 references to Tensor
System.Numerics.Tensors (484)
System\Numerics\Tensors\netcore\ReadOnlyTensorSpan_1.cs (1)
468
Tensor
<T> tmp = Tensor.Create<T>(Lengths, IsPinned);
System\Numerics\Tensors\netcore\Tensor.cs (456)
52
/// Broadcast the data from <paramref name="source"/> to the smallest broadcastable shape compatible with <paramref name="lengthsSource"/>. Creates a new <see cref="
Tensor
{T}"/> and allocates new memory.
54
/// <param name="source">Input <see cref="
Tensor
{T}"/>.</param>
55
/// <param name="lengthsSource">Other <see cref="
Tensor
{T}"/> to make shapes broadcastable.</param>
56
public static
Tensor
<T> Broadcast<T>(scoped in ReadOnlyTensorSpan<T> source, scoped in ReadOnlyTensorSpan<T> lengthsSource)
62
/// Broadcast the data from <paramref name="source"/> to the new shape <paramref name="lengths"/>. Creates a new <see cref="
Tensor
{T}"/> and allocates new memory.
65
/// <param name="source">Input <see cref="
Tensor
{T}"/>.</param>
68
public static
Tensor
<T> Broadcast<T>(scoped in ReadOnlyTensorSpan<T> source, scoped ReadOnlySpan<nint> lengths)
71
Tensor
<T> destination = CreateUninitialized<T>(lengths);
83
public static void BroadcastTo<T>(this
Tensor
<T> source, in TensorSpan<T> destination)
117
public static
Tensor
<T> Concatenate<T>(params scoped ReadOnlySpan<
Tensor
<T>> tensors)
127
public static
Tensor
<T> ConcatenateOnDimension<T>(int dimension, params scoped ReadOnlySpan<
Tensor
<T>> tensors)
135
Tensor
<T> tensor;
188
public static ref readonly TensorSpan<T> Concatenate<T>(scoped ReadOnlySpan<
Tensor
<T>> tensors, in TensorSpan<T> destination)
200
public static ref readonly TensorSpan<T> ConcatenateOnDimension<T>(int dimension, scoped ReadOnlySpan<
Tensor
<T>> tensors, in TensorSpan<T> destination)
268
Tensor
<T> slice = tensors[i].Slice(ranges);
297
public static
Tensor
<T> Create<T>(scoped ReadOnlySpan<nint> lengths, bool pinned = false)
302
public static
Tensor
<T> Create<T>(scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides, bool pinned = false)
307
public static
Tensor
<T> Create<T>(T[] array)
312
public static
Tensor
<T> Create<T>(T[] array, scoped ReadOnlySpan<nint> lengths)
317
public static
Tensor
<T> Create<T>(T[] array, scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides)
322
public static
Tensor
<T> Create<T>(T[] array, int start, scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides)
326
public static
Tensor
<T> Create<T>(IEnumerable<T> enumerable, bool pinned = false)
332
Tensor
<T> tensor = CreateUninitialized<T>([array.Length], pinned);
345
public static
Tensor
<T> Create<T>(IEnumerable<T> enumerable, scoped ReadOnlySpan<nint> lengths, bool pinned = false)
350
public static
Tensor
<T> Create<T>(IEnumerable<T> enumerable, scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides, bool pinned = false)
356
Tensor
<T> tensor = CreateUninitialized<T>(lengths, strides, pinned);
368
/// Creates a <see cref="
Tensor
{T}"/> and initializes it with random data in a gaussian normal distribution.
371
public static
Tensor
<T> CreateAndFillGaussianNormalDistribution<T>(scoped ReadOnlySpan<nint> lengths)
378
/// Creates a <see cref="
Tensor
{T}"/> and initializes it with random data in a gaussian normal distribution.
382
public static
Tensor
<T> CreateAndFillGaussianNormalDistribution<T>(Random random, scoped ReadOnlySpan<nint> lengths)
385
Tensor
<T> tensor = CreateUninitialized<T>(lengths);
392
/// Creates a <see cref="
Tensor
{T}"/> and initializes it with random data uniformly distributed.
395
public static
Tensor
<T> CreateAndFillUniformDistribution<T>(scoped ReadOnlySpan<nint> lengths)
402
/// Creates a <see cref="
Tensor
{T}"/> and initializes it with random data uniformly distributed.
406
public static
Tensor
<T> CreateAndFillUniformDistribution<T>(Random random, scoped ReadOnlySpan<nint> lengths)
409
Tensor
<T> tensor = CreateUninitialized<T>(lengths);
415
public static
Tensor
<T> CreateUninitialized<T>(scoped ReadOnlySpan<nint> lengths, bool pinned = false)
419
public static
Tensor
<T> CreateUninitialized<T>(scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides, bool pinned = false)
478
public static
Tensor
<bool> Equals<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
481
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<bool> destination);
509
public static
Tensor
<bool> Equals<T>(in ReadOnlyTensorSpan<T> x, T y)
512
Tensor
<bool> destination = CreateUninitialized<bool>(x.Lengths);
598
/// <param name="tensor">Input <see cref="
Tensor
{T}"/>.</param>
612
/// <param name="tensor">Input <see cref="
Tensor
{T}"/>.</param>
627
/// It returns a <see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/>
632
/// <returns>A <see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/> and
634
public static
Tensor
<bool> GreaterThan<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
637
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<bool> destination);
645
/// It returns a <see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/>
651
/// <returns>A <see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/> and
663
/// It returns a <see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/>
668
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/>
670
public static
Tensor
<bool> GreaterThan<T>(in ReadOnlyTensorSpan<T> x, T y)
673
Tensor
<bool> destination = Create<bool>(x.Lengths, false);
680
/// It returns a <see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/>
686
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/>
698
/// It returns a <see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/>
703
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/>
705
public static
Tensor
<bool> GreaterThan<T>(T x, in ReadOnlyTensorSpan<T> y)
710
/// It returns a <see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/>
716
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/>
808
/// It returns a <see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/>
813
/// <returns>A <see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/> and
815
public static
Tensor
<bool> GreaterThanOrEqual<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
818
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<bool> destination);
826
/// It returns a <see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/>
832
/// <returns>A <see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/> and
844
/// It returns a <see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/>
849
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/>
851
public static
Tensor
<bool> GreaterThanOrEqual<T>(in ReadOnlyTensorSpan<T> x, T y)
854
Tensor
<bool> destination = Create<bool>(x.Lengths, false);
861
/// It returns a <see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/>
867
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/>
879
/// It returns a <see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/>
884
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/>
886
public static
Tensor
<bool> GreaterThanOrEqual<T>(T x, in ReadOnlyTensorSpan<T> y)
891
/// It returns a <see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/>
897
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/>
989
/// It returns a <see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/>
994
/// <returns>A <see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/> and
996
public static
Tensor
<bool> LessThan<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
999
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<bool> destination);
1007
/// It returns a <see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/>
1013
/// <returns>A <see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/> and
1024
/// Compares the elements of a <see cref="
Tensor
{T}"/> to see which elements are less than <paramref name="y"/>.
1025
/// It returns a <see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/>
1028
/// <param name="x"><see cref="
Tensor
{T}"/> to compare.</param>
1030
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/>
1032
public static
Tensor
<bool> LessThan<T>(in ReadOnlyTensorSpan<T> x, T y)
1035
Tensor
<bool> destination = Create<bool>(x.Lengths, false);
1041
/// Compares the elements of a <see cref="
Tensor
{T}"/> to see which elements are less than <paramref name="y"/>.
1042
/// It returns a <see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/>
1045
/// <param name="x"><see cref="
Tensor
{T}"/> to compare.</param>
1048
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/>
1059
/// Compares the elements of a <see cref="
Tensor
{T}"/> to see which elements are less than <paramref name="y"/>.
1060
/// It returns a <see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/>
1063
/// <param name="x"><see cref="
Tensor
{T}"/> to compare.</param>
1065
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/>
1067
public static
Tensor
<bool> LessThan<T>(T x, in ReadOnlyTensorSpan<T> y)
1071
/// Compares the elements of a <see cref="
Tensor
{T}"/> to see which elements are less than <paramref name="y"/>.
1072
/// It returns a <see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/>
1075
/// <param name="x"><see cref="
Tensor
{T}"/> to compare.</param>
1078
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/>
1170
/// It returns a <see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/>
1175
/// <returns>A <see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/> and
1177
public static
Tensor
<bool> LessThanOrEqual<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
1180
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<bool> destination);
1188
/// It returns a <see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/>
1194
/// <returns>A <see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/> and
1205
/// Compares the elements of a <see cref="
Tensor
{T}"/> to see which elements are less than <paramref name="y"/>.
1206
/// It returns a <see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/>
1209
/// <param name="x"><see cref="
Tensor
{T}"/> to compare.</param>
1211
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/>
1213
public static
Tensor
<bool> LessThanOrEqual<T>(in ReadOnlyTensorSpan<T> x, T y)
1216
Tensor
<bool> destination = Create<bool>(x.Lengths, false);
1222
/// Compares the elements of a <see cref="
Tensor
{T}"/> to see which elements are less than <paramref name="y"/>.
1223
/// It returns a <see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/>
1226
/// <param name="x"><see cref="
Tensor
{T}"/> to compare.</param>
1229
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/>
1240
/// Compares the elements of a <see cref="
Tensor
{T}"/> to see which elements are less than <paramref name="y"/>.
1241
/// It returns a <see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/>
1244
/// <param name="x"><see cref="
Tensor
{T}"/> to compare.</param>
1246
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/>
1248
public static
Tensor
<bool> LessThanOrEqual<T>(T x, in ReadOnlyTensorSpan<T> y)
1252
/// Compares the elements of a <see cref="
Tensor
{T}"/> to see which elements are less than <paramref name="y"/>.
1253
/// It returns a <see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/>
1256
/// <param name="x"><see cref="
Tensor
{T}"/> to compare.</param>
1259
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/>
1351
/// If <paramref name="tensor"/> is a 1D tensor, it will return <paramref name="tensor"/>. Otherwise it creates a new <see cref="
Tensor
{T}"/>
1354
/// <param name="tensor">Input <see cref="
Tensor
{T}"/></param>
1356
public static
Tensor
<T> PermuteDimensions<T>(this
Tensor
<T> tensor, ReadOnlySpan<int> dimensions)
1370
Tensor
<T> outTensor;
1408
/// <param name="tensor"><see cref="
Tensor
{T}"/> you want to reshape.</param>
1410
public static
Tensor
<T> Reshape<T>(this
Tensor
<T> tensor, ReadOnlySpan<nint> lengths)
1630
/// Creates a new <see cref="
Tensor
{T}"/>, allocates new memory, and copies the data from <paramref name="tensor"/>. If the final shape is smaller all data after
1633
/// <param name="tensor">Input <see cref="
Tensor
{T}"/>.</param>
1635
public static
Tensor
<T> Resize<T>(
Tensor
<T> tensor, ReadOnlySpan<nint> lengths)
1639
Tensor
<T> output = Create(values, lengths, []);
1654
/// <param name="tensor">Input <see cref="
Tensor
{T}"/>.</param>
1656
public static void ResizeTo<T>(scoped in
Tensor
<T> tensor, in TensorSpan<T> destination)
1693
/// <param name="tensor">Input <see cref="
Tensor
{T}"/>.</param>
1694
public static
Tensor
<T> Reverse<T>(in ReadOnlyTensorSpan<T> tensor)
1696
Tensor
<T> output = Create<T>(tensor.Lengths);
1706
/// <param name="tensor">Input <see cref="
Tensor
{T}"/>.</param>
1708
public static
Tensor
<T> ReverseDimension<T>(in ReadOnlyTensorSpan<T> tensor, int dimension)
1710
Tensor
<T> output = Create<T>(tensor.Lengths);
1798
/// <param name="tensor">Input <see cref="
Tensor
{T}"/>.</param>
1801
public static
Tensor
<T> SetSlice<T>(this
Tensor
<T> tensor, in ReadOnlyTensorSpan<T> values, params ReadOnlySpan<NRange> ranges)
1810
/// <param name="tensor">Input <see cref="
Tensor
{T}"/>.</param>
1829
/// Split a <see cref="
Tensor
{T}"/> into <paramref name="splitCount"/> along the given <paramref name="dimension"/>. If the tensor cannot be split
1832
/// <param name="tensor">Input <see cref="
Tensor
{T}"/>.</param>
1835
public static
Tensor
<T>[] Split<T>(scoped in ReadOnlyTensorSpan<T> tensor, int splitCount, nint dimension)
1842
Tensor
<T>[] outputs = new
Tensor
<T>[splitCount];
1875
/// <param name="tensor">The <see cref="
Tensor
{T}"/> to remove all dimensions of length 1.</param>
1876
public static
Tensor
<T> Squeeze<T>(this
Tensor
<T> tensor)
1885
/// <param name="tensor">The <see cref="
Tensor
{T}"/> to remove dimension of length 1.</param>
1887
public static
Tensor
<T> SqueezeDimension<T>(this
Tensor
<T> tensor, int dimension)
1931
Tensor
<T> output = new Tensor<T>(tensor._values, tensor._start, lengths[..rank], strides[..rank]);
2076
/// Join multiple <see cref="
Tensor
{T}"/> along a new dimension that is added at position 0. All tensors must have the same shape.
2078
/// <param name="tensors">Input <see cref="
Tensor
{T}"/>.</param>
2079
public static
Tensor
<T> Stack<T>(params ReadOnlySpan<
Tensor
<T>> tensors)
2085
/// Join multiple <see cref="
Tensor
{T}"/> along a new dimension. The axis parameter specifies the index of the new dimension. All tensors must have the same shape.
2087
/// <param name="tensors">Input <see cref="
Tensor
{T}"/>.</param>
2089
public static
Tensor
<T> StackAlongDimension<T>(int dimension, params ReadOnlySpan<
Tensor
<T>> tensors)
2105
Tensor
<T>[] outputs = new
Tensor
<T>[tensors.Length];
2114
/// Join multiple <see cref="
Tensor
{T}"/> along a new dimension that is added at position 0. All tensors must have the same shape.
2116
/// <param name="tensors">Input <see cref="
Tensor
{T}"/>.</param>
2118
public static ref readonly TensorSpan<T> Stack<T>(scoped in ReadOnlySpan<
Tensor
<T>> tensors, in TensorSpan<T> destination)
2124
/// Join multiple <see cref="
Tensor
{T}"/> along a new dimension. The axis parameter specifies the index of the new dimension. All tensors must have the same shape.
2126
/// <param name="tensors">Input <see cref="
Tensor
{T}"/>.</param>
2129
public static ref readonly TensorSpan<T> StackAlongDimension<T>(scoped ReadOnlySpan<
Tensor
<T>> tensors, in TensorSpan<T> destination, int dimension)
2145
Tensor
<T>[] outputs = new
Tensor
<T>[tensors.Length];
2239
/// Creates a <see cref="string"/> representation of the <see cref="
Tensor
{T}"/>."/>
2244
public static string ToString<T>(this
Tensor
<T> tensor, ReadOnlySpan<nint> maximumLengths)
2253
/// <param name="tensor">Input <see cref="
Tensor
{T}"/>.</param>
2254
public static
Tensor
<T> Transpose<T>(
Tensor
<T> tensor)
2273
Tensor
<T> output = new Tensor<T>(tensor._values, tensor._start, lengths, strides);
2287
/// <param name="tensor">Input <see cref="
Tensor
{T}"/>.</param>
2289
public static bool TryBroadcastTo<T>(this
Tensor
<T> tensor, in TensorSpan<T> destination)
2326
/// <param name="tensor">The <see cref="
Tensor
{T}"/> to add a dimension of length 1.</param>
2328
public static
Tensor
<T> Unsqueeze<T>(this
Tensor
<T> tensor, int dimension)
2354
Tensor
<T> output = new Tensor<T>(tensor._values, tensor._start, newLengths, newStrides);
2438
/// Takes the absolute value of each element of the <see cref="
Tensor
{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
2441
public static
Tensor
<T> Abs<T>(in ReadOnlyTensorSpan<T> x)
2444
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
2465
/// Takes the inverse cosine of each element of the <see cref="
Tensor
{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
2468
public static
Tensor
<T> Acos<T>(in ReadOnlyTensorSpan<T> x)
2471
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
2477
/// Takes the inverse cosine of each element of the <see cref="
Tensor
{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
2492
/// Takes the inverse hyperbolic cosine of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
2495
public static
Tensor
<T> Acosh<T>(in ReadOnlyTensorSpan<T> x)
2498
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
2519
/// Takes the inverse hyperbolic cosine divided by pi of each element of the <see cref="
Tensor
{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
2522
public static
Tensor
<T> AcosPi<T>(in ReadOnlyTensorSpan<T> x)
2525
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
2546
/// Adds each element of <paramref name="x"/> to each element of <paramref name="y"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
2550
public static
Tensor
<T> Add<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
2553
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<T> destination);
2559
/// Adds <paramref name="y"/> to each element of <paramref name="x"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
2563
public static
Tensor
<T> Add<T>(in ReadOnlyTensorSpan<T> x, T y)
2566
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
2602
/// Takes the inverse sin of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
2605
public static
Tensor
<T> Asin<T>(in ReadOnlyTensorSpan<T> x)
2608
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
2629
/// Takes the inverse hyperbolic sine of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
2632
public static
Tensor
<T> Asinh<T>(in ReadOnlyTensorSpan<T> x)
2635
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
2656
/// Takes the inverse hyperbolic sine divided by pi of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
2659
public static
Tensor
<T> AsinPi<T>(in ReadOnlyTensorSpan<T> x)
2662
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
2683
/// Takes the arc tangent of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
2686
public static
Tensor
<T> Atan<T>(in ReadOnlyTensorSpan<T> x)
2689
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
2710
/// Takes the arc tangent of the two input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
2714
public static
Tensor
<T> Atan2<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
2717
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
2737
/// Takes the arc tangent of the two input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
2741
public static
Tensor
<T> Atan2<T>(in ReadOnlyTensorSpan<T> x, T y)
2744
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
2764
/// Takes the arc tangent of the two input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
2768
public static
Tensor
<T> Atan2<T>(T x, in ReadOnlyTensorSpan<T> y)
2771
Tensor
<T> destination = CreateUninitialized<T>(y.Lengths);
2793
/// Takes the arc tangent of the two input <see cref="ReadOnlyTensorSpan{T}"/>, divides each element by pi, and returns a new <see cref="
Tensor
{T}"/> with the result.
2797
public static
Tensor
<T> Atan2Pi<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
2800
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
2824
public static
Tensor
<T> Atan2Pi<T>(in ReadOnlyTensorSpan<T> x, T y)
2827
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
2851
public static
Tensor
<T> Atan2Pi<T>(T x, in ReadOnlyTensorSpan<T> y)
2854
Tensor
<T> destination = CreateUninitialized<T>(y.Lengths);
2876
/// Takes the inverse hyperbolic tangent of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
2879
public static
Tensor
<T> Atanh<T>(in ReadOnlyTensorSpan<T> x)
2882
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
2903
/// Takes the inverse hyperbolic tangent divided by pi of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
2906
public static
Tensor
<T> AtanPi<T>(in ReadOnlyTensorSpan<T> x)
2909
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
2947
/// Computes the element-wise bitwise and of the two input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
2951
public static
Tensor
<T> BitwiseAnd<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
2954
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
2974
/// Computes the element-wise bitwise and of the two input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
2978
public static
Tensor
<T> BitwiseAnd<T>(in ReadOnlyTensorSpan<T> x, T y)
2981
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
3003
/// Computes the element-wise bitwise of of the two input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
3007
public static
Tensor
<T> BitwiseOr<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
3010
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
3030
/// Computes the element-wise bitwise or of the two input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
3034
public static
Tensor
<T> BitwiseOr<T>(in ReadOnlyTensorSpan<T> x, T y)
3037
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
3059
/// Computes the element-wise cube root of the input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
3062
public static
Tensor
<T> Cbrt<T>(in ReadOnlyTensorSpan<T> x)
3065
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
3086
/// Computes the element-wise ceiling of the input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
3089
public static
Tensor
<T> Ceiling<T>(in ReadOnlyTensorSpan<T> x)
3092
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
3117
public static
Tensor
<TTo> ConvertChecked<TFrom, TTo>(in ReadOnlyTensorSpan<TFrom> source)
3121
Tensor
<TTo> destination = CreateUninitialized<TTo>(source.Lengths);
3148
public static
Tensor
<TTo> ConvertSaturating<TFrom, TTo>(in ReadOnlyTensorSpan<TFrom> source)
3152
Tensor
<TTo> destination = CreateUninitialized<TTo>(source.Lengths);
3179
public static
Tensor
<TTo> ConvertTruncating<TFrom, TTo>(in ReadOnlyTensorSpan<TFrom> source)
3183
Tensor
<TTo> destination = CreateUninitialized<TTo>(source.Lengths);
3210
public static
Tensor
<T> CopySign<T>(in ReadOnlyTensorSpan<T> x, T sign)
3213
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
3219
/// Computes the element-wise result of copying the sign from one number to another number in the specified tensors and returns a new <see cref="
Tensor
{T}"/> with the result.
3223
public static
Tensor
<T> CopySign<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> sign)
3226
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
3262
/// Takes the cosine of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
3265
public static
Tensor
<T> Cos<T>(in ReadOnlyTensorSpan<T> x)
3268
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
3289
/// Takes the hyperbolic cosine of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
3292
public static
Tensor
<T> Cosh<T>(in ReadOnlyTensorSpan<T> x)
3295
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
3331
/// <summary>Computes the element-wise cosine of the value in the specified tensor that has been multiplied by Pi and returns a new <see cref="
Tensor
{T}"/> with the results.</summary>
3345
public static
Tensor
<T> CosPi<T>(in ReadOnlyTensorSpan<T> x)
3348
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
3382
public static
Tensor
<T> DegreesToRadians<T>(in ReadOnlyTensorSpan<T> x)
3385
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
3422
/// Divides each element of <paramref name="x"/> by <paramref name="y"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
3426
public static
Tensor
<T> Divide<T>(in ReadOnlyTensorSpan<T> x, T y)
3429
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
3435
/// Divides <paramref name="x"/> by each element of <paramref name="y"/> and returns a new <see cref="
Tensor
{T}"/> with the result."/>
3439
public static
Tensor
<T> Divide<T>(T x, in ReadOnlyTensorSpan<T> y)
3442
Tensor
<T> destination = CreateUninitialized<T>(y.Lengths);
3453
public static
Tensor
<T> Divide<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
3456
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<T> destination);
3526
public static
Tensor
<T> Exp<T>(in ReadOnlyTensorSpan<T> x)
3529
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
3553
public static
Tensor
<T> Exp10<T>(in ReadOnlyTensorSpan<T> x)
3556
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
3578
public static
Tensor
<T> Exp10M1<T>(in ReadOnlyTensorSpan<T> x)
3581
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
3601
public static
Tensor
<T> Exp2<T>(in ReadOnlyTensorSpan<T> x)
3604
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
3624
public static
Tensor
<T> Exp2M1<T>(in ReadOnlyTensorSpan<T> x)
3627
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
3647
public static
Tensor
<T> ExpM1<T>(in ReadOnlyTensorSpan<T> x)
3650
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
3670
public static
Tensor
<T> Floor<T>(in ReadOnlyTensorSpan<T> x)
3673
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
3697
public static
Tensor
<T> Hypot<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
3700
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<T> destination);
3726
public static
Tensor
<T> Ieee754Remainder<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
3729
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<T> destination);
3750
public static
Tensor
<T> Ieee754Remainder<T>(in ReadOnlyTensorSpan<T> x, T y)
3753
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
3773
public static
Tensor
<T> Ieee754Remainder<T>(T x, in ReadOnlyTensorSpan<T> y)
3776
Tensor
<T> destination = CreateUninitialized<T>(y.Lengths);
3797
public static
Tensor
<int> ILogB<T>(in ReadOnlyTensorSpan<T> x)
3800
Tensor
<int> destination = CreateUninitialized<int>(x.Lengths);
3869
public static
Tensor
<T> LeadingZeroCount<T>(in ReadOnlyTensorSpan<T> x)
3872
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
3893
/// Takes the natural logarithm of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
3896
public static
Tensor
<T> Log<T>(in ReadOnlyTensorSpan<T> x)
3899
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
3920
public static
Tensor
<T> Log<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
3923
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<T> destination);
3943
public static
Tensor
<T> Log<T>(in ReadOnlyTensorSpan<T> x, T y)
3946
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
3966
/// Takes the base 10 logarithm of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
3969
public static
Tensor
<T> Log10<T>(in ReadOnlyTensorSpan<T> x)
3972
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
3993
/// Takes the base 10 logarithm plus 1 of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
3996
public static
Tensor
<T> Log10P1<T>(in ReadOnlyTensorSpan<T> x)
3999
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
4020
/// Takes the base 2 logarithm of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
4023
public static
Tensor
<T> Log2<T>(in ReadOnlyTensorSpan<T> x)
4026
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
4047
/// Takes the base 2 logarithm plus 1 of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
4050
public static
Tensor
<T> Log2P1<T>(in ReadOnlyTensorSpan<T> x)
4053
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
4074
/// Takes the natural logarithm plus 1 of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
4077
public static
Tensor
<T> LogP1<T>(in ReadOnlyTensorSpan<T> x)
4080
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
4118
public static
Tensor
<T> Max<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
4121
TensorOperation.ValidateCompatibility(in x, in y, out
Tensor
<T> output);
4141
public static
Tensor
<T> Max<T>(in ReadOnlyTensorSpan<T> x, T y)
4144
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
4181
public static
Tensor
<T> MaxMagnitude<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
4184
TensorOperation.ValidateCompatibility(in x, in y, out
Tensor
<T> destination);
4204
public static
Tensor
<T> MaxMagnitude<T>(in ReadOnlyTensorSpan<T> x, T y)
4207
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
4244
public static
Tensor
<T> MaxMagnitudeNumber<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
4247
TensorOperation.ValidateCompatibility(in x, in y, out
Tensor
<T> destination);
4267
public static
Tensor
<T> MaxMagnitudeNumber<T>(in ReadOnlyTensorSpan<T> x, T y)
4270
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
4307
public static
Tensor
<T> MaxNumber<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
4310
TensorOperation.ValidateCompatibility(in x, in y, out
Tensor
<T> destination);
4330
public static
Tensor
<T> MaxNumber<T>(in ReadOnlyTensorSpan<T> x, T y)
4333
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
4370
public static
Tensor
<T> Min<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
4373
TensorOperation.ValidateCompatibility(in x, in y, out
Tensor
<T> output);
4393
public static
Tensor
<T> Min<T>(in ReadOnlyTensorSpan<T> x, T y)
4396
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
4433
public static
Tensor
<T> MinMagnitude<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
4436
TensorOperation.ValidateCompatibility(in x, in y, out
Tensor
<T> destination);
4456
public static
Tensor
<T> MinMagnitude<T>(in ReadOnlyTensorSpan<T> x, T y)
4459
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
4496
public static
Tensor
<T> MinMagnitudeNumber<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
4499
TensorOperation.ValidateCompatibility(in x, in y, out
Tensor
<T> destination);
4519
public static
Tensor
<T> MinMagnitudeNumber<T>(in ReadOnlyTensorSpan<T> x, T y)
4522
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
4559
public static
Tensor
<T> MinNumber<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
4562
TensorOperation.ValidateCompatibility(in x, in y, out
Tensor
<T> destination);
4582
public static
Tensor
<T> MinNumber<T>(in ReadOnlyTensorSpan<T> x, T y)
4585
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
4605
/// Multiplies each element of <paramref name="x"/> with <paramref name="y"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
4609
public static
Tensor
<T> Multiply<T>(in ReadOnlyTensorSpan<T> x, T y)
4612
Tensor
<T> destination = Create<T>(x.Lengths);
4618
/// Multiplies each element of <paramref name="x"/> with <paramref name="y"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
4623
public static
Tensor
<T> Multiply<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
4626
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<T> destination);
4664
public static
Tensor
<T> Negate<T>(in ReadOnlyTensorSpan<T> x)
4667
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
4701
public static
Tensor
<T> OnesComplement<T>(in ReadOnlyTensorSpan<T> x)
4704
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
4724
public static
Tensor
<T> PopCount<T>(in ReadOnlyTensorSpan<T> x)
4727
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
4748
public static
Tensor
<T> Pow<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
4751
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<T> destination);
4771
public static
Tensor
<T> Pow<T>(in ReadOnlyTensorSpan<T> x, T y)
4774
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
4794
public static
Tensor
<T> Pow<T>(T x, in ReadOnlyTensorSpan<T> y)
4797
Tensor
<T> destination = CreateUninitialized<T>(y.Lengths);
4830
public static
Tensor
<T> RadiansToDegrees<T>(in ReadOnlyTensorSpan<T> x)
4833
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
4853
public static
Tensor
<T> Reciprocal<T>(in ReadOnlyTensorSpan<T> x)
4856
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
4877
public static
Tensor
<T> RootN<T>(in ReadOnlyTensorSpan<T> x, int n)
4880
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
4903
public static
Tensor
<T> RotateLeft<T>(in ReadOnlyTensorSpan<T> x, int rotateAmount)
4906
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
4930
public static
Tensor
<T> RotateRight<T>(in ReadOnlyTensorSpan<T> x, int rotateAmount)
4933
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
4955
public static
Tensor
<T> Round<T>(in ReadOnlyTensorSpan<T> x)
4958
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
4978
public static
Tensor
<T> Round<T>(in ReadOnlyTensorSpan<T> x, int digits, MidpointRounding mode)
4981
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
5002
public static
Tensor
<T> Round<T>(in ReadOnlyTensorSpan<T> x, int digits)
5005
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
5025
public static
Tensor
<T> Round<T>(in ReadOnlyTensorSpan<T> x, MidpointRounding mode)
5028
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
5049
public static
Tensor
<T> Sigmoid<T>(in ReadOnlyTensorSpan<T> x)
5052
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
5071
/// Takes the sin of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
5074
public static
Tensor
<T> Sin<T>(in ReadOnlyTensorSpan<T> x)
5077
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
5099
public static
Tensor
<T> Sinh<T>(in ReadOnlyTensorSpan<T> x)
5102
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
5122
public static
Tensor
<T> SinPi<T>(in ReadOnlyTensorSpan<T> x)
5125
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
5145
public static
Tensor
<T> SoftMax<T>(in ReadOnlyTensorSpan<T> x)
5151
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
5173
/// Takes the square root of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
5176
public static
Tensor
<T> Sqrt<T>(in ReadOnlyTensorSpan<T> x)
5179
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
5218
/// Subtracts <paramref name="y"/> from each element of <paramref name="x"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
5222
public static
Tensor
<T> Subtract<T>(in ReadOnlyTensorSpan<T> x, T y)
5225
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
5231
/// Subtracts each element of <paramref name="y"/> from <paramref name="x"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
5235
public static
Tensor
<T> Subtract<T>(T x, in ReadOnlyTensorSpan<T> y)
5238
Tensor
<T> destination = CreateUninitialized<T>(y.Lengths);
5244
/// Subtracts each element of <paramref name="x"/> from <paramref name="y"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
5248
public static
Tensor
<T> Subtract<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
5251
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<T> destination);
5332
public static
Tensor
<T> Tan<T>(in ReadOnlyTensorSpan<T> x)
5335
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
5355
public static
Tensor
<T> Tanh<T>(in ReadOnlyTensorSpan<T> x)
5358
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
5378
public static
Tensor
<T> TanPi<T>(in ReadOnlyTensorSpan<T> x)
5381
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
5401
public static
Tensor
<T> TrailingZeroCount<T>(in ReadOnlyTensorSpan<T> x)
5404
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
5424
public static
Tensor
<T> Truncate<T>(in ReadOnlyTensorSpan<T> x)
5427
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
5448
public static
Tensor
<T> Xor<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
5451
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<T> destination);
5469
/// Computes the element-wise Xor of the two input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
5473
public static
Tensor
<T> Xor<T>(in ReadOnlyTensorSpan<T> x, T y)
5476
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
System\Numerics\Tensors\netcore\Tensor_1.cs (26)
18
public sealed class Tensor<T> : ITensor<
Tensor
<T>, T>, IEnumerable<T>
21
public static
Tensor
<T> Empty { get; } = new();
93
public
Tensor
<T> this[params ReadOnlySpan<NRange> ranges]
126
public static implicit operator
Tensor
<T>(T[] array) => Tensor.Create(array);
131
public static implicit operator TensorSpan<T>(
Tensor
<T> tensor) => tensor.AsTensorSpan();
134
public static implicit operator ReadOnlyTensorSpan<T>(
Tensor
<T> tensor) => tensor.AsReadOnlyTensorSpan();
209
public
Tensor
<T> Slice(params ReadOnlySpan<nint> startIndexes)
224
public
Tensor
<T> Slice(params ReadOnlySpan<NIndex> startIndexes)
239
public
Tensor
<T> Slice(params ReadOnlySpan<NRange> ranges)
254
public
Tensor
<T> ToDenseTensor()
256
Tensor
<T> result = this;
277
/// <returns>A <see cref="string"/> representation of the <see cref="
Tensor
{T}"/></returns>
313
ref readonly T IReadOnlyTensor<
Tensor
<T>, T>.this[params ReadOnlySpan<nint> indexes] => ref this[indexes];
315
ref readonly T IReadOnlyTensor<
Tensor
<T>, T>.this[params ReadOnlySpan<NIndex> indexes] => ref this[indexes];
317
ReadOnlyTensorDimensionSpan<T> IReadOnlyTensor<
Tensor
<T>, T>.GetDimensionSpan(int dimension) => AsReadOnlyTensorSpan().GetDimensionSpan(dimension);
319
ref readonly T IReadOnlyTensor<
Tensor
<T>, T>.GetPinnableReference() => ref GetPinnableReference();
353
static
Tensor
<T> ITensor<
Tensor
<T>, T>.Create(scoped ReadOnlySpan<nint> lengths, bool pinned) => Tensor.Create<T>(lengths, pinned);
355
static
Tensor
<T> ITensor<
Tensor
<T>, T>.Create(scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides, bool pinned) => Tensor.Create<T>(lengths, strides, pinned);
357
static
Tensor
<T> ITensor<
Tensor
<T>, T>.CreateUninitialized(scoped ReadOnlySpan<nint> lengths, bool pinned) => Tensor.CreateUninitialized<T>(lengths, pinned);
359
static
Tensor
<T> ITensor<
Tensor
<T>, T>.CreateUninitialized(scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides, bool pinned) => Tensor.CreateUninitialized<T>(lengths, strides, pinned);
364
private readonly
Tensor
<T> _tensor;
369
internal Enumerator(
Tensor
<T> tensor)
System\Numerics\Tensors\netcore\TensorOperation.cs (1)
359
public static void ValidateCompatibility<TArg, TResult>(in ReadOnlyTensorSpan<TArg> x, in ReadOnlyTensorSpan<TArg> y, out
Tensor
<TResult> destination)