18 instantiations of Tensor
System.Numerics.Tensors (18)
System\Numerics\Tensors\netcore\Tensor.cs (14)
301
=> new
Tensor
<T>(lengths, strides: [], pinned);
306
=> new
Tensor
<T>(lengths, strides, pinned);
311
=> new
Tensor
<T>(array);
316
=> new
Tensor
<T>(array, lengths);
321
=> new
Tensor
<T>(array, lengths, strides);
326
=> new
Tensor
<T>(array, start, lengths, strides);
422
return new
Tensor
<T>(array, in shape, pinned);
430
return new
Tensor
<T>(values, in shape, pinned);
1402
outTensor = new
Tensor
<T>(tensor._values, tensor._start, newLengths, newStrides, newLinearOrder);
1484
return new
Tensor
<T>(tensor._values, tensor._start, lengths, strides);
1871
outputs[i] = new
Tensor
<T>(values, 0, newShape, [], tensor._shape.LinearRankOrder);
1956
Tensor<T> output = new
Tensor
<T>(tensor._values, tensor._start, lengths[..newRank], strides[..newRank], strideOrder[..newRank]);
2360
Tensor<T> output = new
Tensor
<T>(tensor._values, tensor._start, lengths, strides, strideOrder);
2442
Tensor<T> output = new
Tensor
<T>(tensor._values, tensor._start, newLengths, newStrides);
System\Numerics\Tensors\netcore\Tensor_1.cs (4)
23
public static Tensor<T> Empty { get; } =
new
();
260
return new
Tensor
<T>(
276
return new
Tensor
<T>(
292
return new
Tensor
<T>(
483 references to Tensor
System.Numerics.Tensors (483)
System\Numerics\Tensors\netcore\Tensor.cs (456)
55
/// 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.
57
/// <param name="source">Input <see cref="
Tensor
{T}"/>.</param>
58
/// <param name="lengthsSource">Other <see cref="
Tensor
{T}"/> to make shapes broadcastable.</param>
59
public static
Tensor
<T> Broadcast<T>(scoped in ReadOnlyTensorSpan<T> source, scoped in ReadOnlyTensorSpan<T> lengthsSource)
65
/// 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.
68
/// <param name="source">Input <see cref="
Tensor
{T}"/>.</param>
71
public static
Tensor
<T> Broadcast<T>(scoped in ReadOnlyTensorSpan<T> source, scoped ReadOnlySpan<nint> lengths)
74
Tensor
<T> destination = Tensor.CreateUninitialized<T>(lengths);
86
public static void BroadcastTo<T>(this
Tensor
<T> source, in TensorSpan<T> destination)
120
public static
Tensor
<T> Concatenate<T>(params scoped ReadOnlySpan<
Tensor
<T>> tensors)
130
public static
Tensor
<T> ConcatenateOnDimension<T>(int dimension, params scoped ReadOnlySpan<
Tensor
<T>> tensors)
138
Tensor
<T> tensor;
191
public static ref readonly TensorSpan<T> Concatenate<T>(scoped ReadOnlySpan<
Tensor
<T>> tensors, in TensorSpan<T> destination)
203
public static ref readonly TensorSpan<T> ConcatenateOnDimension<T>(int dimension, scoped ReadOnlySpan<
Tensor
<T>> tensors, in TensorSpan<T> destination)
271
Tensor
<T> slice = tensors[i].Slice(ranges);
300
public static
Tensor
<T> Create<T>(scoped ReadOnlySpan<nint> lengths, bool pinned = false)
305
public static
Tensor
<T> Create<T>(scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides, bool pinned = false)
310
public static
Tensor
<T> Create<T>(T[] array)
315
public static
Tensor
<T> Create<T>(T[] array, scoped ReadOnlySpan<nint> lengths)
320
public static
Tensor
<T> Create<T>(T[] array, scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides)
325
public static
Tensor
<T> Create<T>(T[] array, int start, scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides)
329
public static
Tensor
<T> Create<T>(IEnumerable<T> enumerable, bool pinned = false)
335
Tensor
<T> tensor = CreateUninitialized<T>([array.Length], pinned);
348
public static
Tensor
<T> Create<T>(IEnumerable<T> enumerable, scoped ReadOnlySpan<nint> lengths, bool pinned = false)
353
public static
Tensor
<T> Create<T>(IEnumerable<T> enumerable, scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides, bool pinned = false)
359
Tensor
<T> tensor = CreateUninitialized<T>(lengths, strides, pinned);
371
/// Creates a <see cref="
Tensor
{T}"/> and initializes it with random data in a gaussian normal distribution.
374
public static
Tensor
<T> CreateAndFillGaussianNormalDistribution<T>(scoped ReadOnlySpan<nint> lengths)
381
/// Creates a <see cref="
Tensor
{T}"/> and initializes it with random data in a gaussian normal distribution.
385
public static
Tensor
<T> CreateAndFillGaussianNormalDistribution<T>(Random random, scoped ReadOnlySpan<nint> lengths)
388
Tensor
<T> tensor = CreateUninitialized<T>(lengths);
395
/// Creates a <see cref="
Tensor
{T}"/> and initializes it with random data uniformly distributed.
398
public static
Tensor
<T> CreateAndFillUniformDistribution<T>(scoped ReadOnlySpan<nint> lengths)
405
/// Creates a <see cref="
Tensor
{T}"/> and initializes it with random data uniformly distributed.
409
public static
Tensor
<T> CreateAndFillUniformDistribution<T>(Random random, scoped ReadOnlySpan<nint> lengths)
412
Tensor
<T> tensor = CreateUninitialized<T>(lengths);
418
public static
Tensor
<T> CreateUninitialized<T>(scoped ReadOnlySpan<nint> lengths, bool pinned = false)
426
public static
Tensor
<T> CreateUninitialized<T>(scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides, bool pinned = false)
485
public static
Tensor
<bool> Equals<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
488
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<bool> destination);
516
public static
Tensor
<bool> Equals<T>(in ReadOnlyTensorSpan<T> x, T y)
519
Tensor
<bool> destination = CreateUninitialized<bool>(x.Lengths);
605
/// <param name="tensor">Input <see cref="
Tensor
{T}"/>.</param>
619
/// <param name="tensor">Input <see cref="
Tensor
{T}"/>.</param>
634
/// 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"/>
639
/// <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
641
public static
Tensor
<bool> GreaterThan<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
644
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<bool> destination);
652
/// 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"/>
658
/// <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
670
/// 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"/>
675
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/>
677
public static
Tensor
<bool> GreaterThan<T>(in ReadOnlyTensorSpan<T> x, T y)
680
Tensor
<bool> destination = Tensor.Create<bool>(x.Lengths, false);
687
/// 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"/>
693
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/>
705
/// 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"/>
710
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/>
712
public static
Tensor
<bool> GreaterThan<T>(T x, in ReadOnlyTensorSpan<T> y)
717
/// 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"/>
723
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/>
815
/// 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"/>
820
/// <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
822
public static
Tensor
<bool> GreaterThanOrEqual<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
825
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<bool> destination);
833
/// 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"/>
839
/// <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
851
/// 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"/>
856
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/>
858
public static
Tensor
<bool> GreaterThanOrEqual<T>(in ReadOnlyTensorSpan<T> x, T y)
861
Tensor
<bool> destination = Tensor.Create<bool>(x.Lengths, false);
868
/// 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"/>
874
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/>
886
/// 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"/>
891
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/>
893
public static
Tensor
<bool> GreaterThanOrEqual<T>(T x, in ReadOnlyTensorSpan<T> y)
898
/// 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"/>
904
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/>
996
/// 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"/>
1001
/// <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
1003
public static
Tensor
<bool> LessThan<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
1006
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<bool> destination);
1014
/// 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"/>
1020
/// <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
1031
/// Compares the elements of a <see cref="
Tensor
{T}"/> to see which elements are less than <paramref name="y"/>.
1032
/// 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"/>
1035
/// <param name="x"><see cref="
Tensor
{T}"/> to compare.</param>
1037
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/>
1039
public static
Tensor
<bool> LessThan<T>(in ReadOnlyTensorSpan<T> x, T y)
1042
Tensor
<bool> destination = Tensor.Create<bool>(x.Lengths, false);
1048
/// Compares the elements of a <see cref="
Tensor
{T}"/> to see which elements are less than <paramref name="y"/>.
1049
/// 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"/>
1052
/// <param name="x"><see cref="
Tensor
{T}"/> to compare.</param>
1055
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/>
1066
/// Compares the elements of a <see cref="
Tensor
{T}"/> to see which elements are less than <paramref name="y"/>.
1067
/// 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"/>
1070
/// <param name="x"><see cref="
Tensor
{T}"/> to compare.</param>
1072
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/>
1074
public static
Tensor
<bool> LessThan<T>(T x, in ReadOnlyTensorSpan<T> y)
1078
/// Compares the elements of a <see cref="
Tensor
{T}"/> to see which elements are less than <paramref name="y"/>.
1079
/// 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"/>
1082
/// <param name="x"><see cref="
Tensor
{T}"/> to compare.</param>
1085
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/>
1177
/// 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"/>
1182
/// <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
1184
public static
Tensor
<bool> LessThanOrEqual<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
1187
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<bool> destination);
1195
/// 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"/>
1201
/// <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
1212
/// Compares the elements of a <see cref="
Tensor
{T}"/> to see which elements are less than <paramref name="y"/>.
1213
/// 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"/>
1216
/// <param name="x"><see cref="
Tensor
{T}"/> to compare.</param>
1218
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/>
1220
public static
Tensor
<bool> LessThanOrEqual<T>(in ReadOnlyTensorSpan<T> x, T y)
1223
Tensor
<bool> destination = Tensor.Create<bool>(x.Lengths, false);
1229
/// Compares the elements of a <see cref="
Tensor
{T}"/> to see which elements are less than <paramref name="y"/>.
1230
/// 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"/>
1233
/// <param name="x"><see cref="
Tensor
{T}"/> to compare.</param>
1236
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/>
1247
/// Compares the elements of a <see cref="
Tensor
{T}"/> to see which elements are less than <paramref name="y"/>.
1248
/// 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"/>
1251
/// <param name="x"><see cref="
Tensor
{T}"/> to compare.</param>
1253
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/>
1255
public static
Tensor
<bool> LessThanOrEqual<T>(T x, in ReadOnlyTensorSpan<T> y)
1259
/// Compares the elements of a <see cref="
Tensor
{T}"/> to see which elements are less than <paramref name="y"/>.
1260
/// 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"/>
1263
/// <param name="x"><see cref="
Tensor
{T}"/> to compare.</param>
1266
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/>
1358
/// If <paramref name="tensor"/> is a 1D tensor, it will return <paramref name="tensor"/>. Otherwise it creates a new <see cref="
Tensor
{T}"/>
1361
/// <param name="tensor">Input <see cref="
Tensor
{T}"/></param>
1363
public static
Tensor
<T> PermuteDimensions<T>(this
Tensor
<T> tensor, ReadOnlySpan<int> dimensions)
1378
Tensor
<T> outTensor;
1419
/// <param name="tensor"><see cref="
Tensor
{T}"/> you want to reshape.</param>
1421
public static
Tensor
<T> Reshape<T>(this
Tensor
<T> tensor, ReadOnlySpan<nint> lengths)
1641
/// 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
1644
/// <param name="tensor">Input <see cref="
Tensor
{T}"/>.</param>
1646
public static
Tensor
<T> Resize<T>(
Tensor
<T> tensor, ReadOnlySpan<nint> lengths)
1650
Tensor
<T> output = Tensor.Create(values, 0, lengths, []);
1665
/// <param name="tensor">Input <see cref="
Tensor
{T}"/>.</param>
1667
public static void ResizeTo<T>(scoped in
Tensor
<T> tensor, in TensorSpan<T> destination)
1704
/// <param name="tensor">Input <see cref="
Tensor
{T}"/>.</param>
1705
public static
Tensor
<T> Reverse<T>(in ReadOnlyTensorSpan<T> tensor)
1707
Tensor
<T> output = Tensor.Create<T>(tensor.Lengths);
1717
/// <param name="tensor">Input <see cref="
Tensor
{T}"/>.</param>
1719
public static
Tensor
<T> ReverseDimension<T>(in ReadOnlyTensorSpan<T> tensor, int dimension)
1721
Tensor
<T> output = Tensor.Create<T>(tensor.Lengths);
1809
/// <param name="tensor">Input <see cref="
Tensor
{T}"/>.</param>
1812
public static
Tensor
<T> SetSlice<T>(this
Tensor
<T> tensor, in ReadOnlyTensorSpan<T> values, params ReadOnlySpan<NRange> ranges)
1821
/// <param name="tensor">Input <see cref="
Tensor
{T}"/>.</param>
1840
/// Split a <see cref="
Tensor
{T}"/> into <paramref name="splitCount"/> along the given <paramref name="dimension"/>. If the tensor cannot be split
1843
/// <param name="tensor">Input <see cref="
Tensor
{T}"/>.</param>
1846
public static
Tensor
<T>[] Split<T>(scoped in ReadOnlyTensorSpan<T> tensor, int splitCount, nint dimension)
1853
Tensor
<T>[] outputs = new
Tensor
<T>[splitCount];
1886
/// <param name="tensor">The <see cref="
Tensor
{T}"/> to remove all dimensions of length 1.</param>
1887
public static
Tensor
<T> Squeeze<T>(this
Tensor
<T> tensor)
1896
/// <param name="tensor">The <see cref="
Tensor
{T}"/> to remove dimension of length 1.</param>
1898
public static
Tensor
<T> SqueezeDimension<T>(this
Tensor
<T> tensor, int dimension)
1956
Tensor
<T> output = new Tensor<T>(tensor._values, tensor._start, lengths[..newRank], strides[..newRank], strideOrder[..newRank]);
2157
/// Join multiple <see cref="
Tensor
{T}"/> along a new dimension that is added at position 0. All tensors must have the same shape.
2159
/// <param name="tensors">Input <see cref="
Tensor
{T}"/>.</param>
2160
public static
Tensor
<T> Stack<T>(params ReadOnlySpan<
Tensor
<T>> tensors)
2166
/// 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.
2168
/// <param name="tensors">Input <see cref="
Tensor
{T}"/>.</param>
2170
public static
Tensor
<T> StackAlongDimension<T>(int dimension, params ReadOnlySpan<
Tensor
<T>> tensors)
2186
Tensor
<T>[] outputs = new
Tensor
<T>[tensors.Length];
2195
/// Join multiple <see cref="
Tensor
{T}"/> along a new dimension that is added at position 0. All tensors must have the same shape.
2197
/// <param name="tensors">Input <see cref="
Tensor
{T}"/>.</param>
2199
public static ref readonly TensorSpan<T> Stack<T>(scoped in ReadOnlySpan<
Tensor
<T>> tensors, in TensorSpan<T> destination)
2205
/// 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.
2207
/// <param name="tensors">Input <see cref="
Tensor
{T}"/>.</param>
2210
public static ref readonly TensorSpan<T> StackAlongDimension<T>(scoped ReadOnlySpan<
Tensor
<T>> tensors, in TensorSpan<T> destination, int dimension)
2226
Tensor
<T>[] outputs = new
Tensor
<T>[tensors.Length];
2320
/// Creates a <see cref="string"/> representation of the <see cref="
Tensor
{T}"/>."/>
2325
public static string ToString<T>(this
Tensor
<T> tensor, ReadOnlySpan<nint> maximumLengths)
2334
/// <param name="tensor">Input <see cref="
Tensor
{T}"/>.</param>
2335
public static
Tensor
<T> Transpose<T>(
Tensor
<T> tensor)
2360
Tensor
<T> output = new Tensor<T>(tensor._values, tensor._start, lengths, strides, strideOrder);
2375
/// <param name="tensor">Input <see cref="
Tensor
{T}"/>.</param>
2377
public static bool TryBroadcastTo<T>(this
Tensor
<T> tensor, in TensorSpan<T> destination)
2414
/// <param name="tensor">The <see cref="
Tensor
{T}"/> to add a dimension of length 1.</param>
2416
public static
Tensor
<T> Unsqueeze<T>(this
Tensor
<T> tensor, int dimension)
2442
Tensor
<T> output = new Tensor<T>(tensor._values, tensor._start, newLengths, newStrides);
2526
/// Takes the absolute value of each element of the <see cref="
Tensor
{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
2529
public static
Tensor
<T> Abs<T>(in ReadOnlyTensorSpan<T> x)
2532
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
2553
/// Takes the inverse cosine of each element of the <see cref="
Tensor
{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
2556
public static
Tensor
<T> Acos<T>(in ReadOnlyTensorSpan<T> x)
2559
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
2565
/// Takes the inverse cosine of each element of the <see cref="
Tensor
{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
2580
/// 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.
2583
public static
Tensor
<T> Acosh<T>(in ReadOnlyTensorSpan<T> x)
2586
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
2607
/// 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.
2610
public static
Tensor
<T> AcosPi<T>(in ReadOnlyTensorSpan<T> x)
2613
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
2634
/// 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.
2638
public static
Tensor
<T> Add<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
2641
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<T> destination);
2647
/// Adds <paramref name="y"/> to each element of <paramref name="x"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
2651
public static
Tensor
<T> Add<T>(in ReadOnlyTensorSpan<T> x, T y)
2654
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
2690
/// Takes the inverse sin of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
2693
public static
Tensor
<T> Asin<T>(in ReadOnlyTensorSpan<T> x)
2696
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
2717
/// 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.
2720
public static
Tensor
<T> Asinh<T>(in ReadOnlyTensorSpan<T> x)
2723
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
2744
/// 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.
2747
public static
Tensor
<T> AsinPi<T>(in ReadOnlyTensorSpan<T> x)
2750
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
2771
/// Takes the arc tangent of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
2774
public static
Tensor
<T> Atan<T>(in ReadOnlyTensorSpan<T> x)
2777
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
2798
/// Takes the arc tangent of the two input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
2802
public static
Tensor
<T> Atan2<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
2805
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
2825
/// Takes the arc tangent of the two input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
2829
public static
Tensor
<T> Atan2<T>(in ReadOnlyTensorSpan<T> x, T y)
2832
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
2852
/// Takes the arc tangent of the two input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
2856
public static
Tensor
<T> Atan2<T>(T x, in ReadOnlyTensorSpan<T> y)
2859
Tensor
<T> destination = Tensor.CreateUninitialized<T>(y.Lengths);
2881
/// 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.
2885
public static
Tensor
<T> Atan2Pi<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
2888
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
2912
public static
Tensor
<T> Atan2Pi<T>(in ReadOnlyTensorSpan<T> x, T y)
2915
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
2939
public static
Tensor
<T> Atan2Pi<T>(T x, in ReadOnlyTensorSpan<T> y)
2942
Tensor
<T> destination = Tensor.CreateUninitialized<T>(y.Lengths);
2964
/// 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.
2967
public static
Tensor
<T> Atanh<T>(in ReadOnlyTensorSpan<T> x)
2970
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
2991
/// 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.
2994
public static
Tensor
<T> AtanPi<T>(in ReadOnlyTensorSpan<T> x)
2997
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
3035
/// 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.
3039
public static
Tensor
<T> BitwiseAnd<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
3042
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
3062
/// 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.
3066
public static
Tensor
<T> BitwiseAnd<T>(in ReadOnlyTensorSpan<T> x, T y)
3069
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
3091
/// 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.
3095
public static
Tensor
<T> BitwiseOr<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
3098
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
3118
/// 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.
3122
public static
Tensor
<T> BitwiseOr<T>(in ReadOnlyTensorSpan<T> x, T y)
3125
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
3147
/// Computes the element-wise cube root of the input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
3150
public static
Tensor
<T> Cbrt<T>(in ReadOnlyTensorSpan<T> x)
3153
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
3174
/// Computes the element-wise ceiling of the input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
3177
public static
Tensor
<T> Ceiling<T>(in ReadOnlyTensorSpan<T> x)
3180
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
3205
public static
Tensor
<TTo> ConvertChecked<TFrom, TTo>(in ReadOnlyTensorSpan<TFrom> source)
3209
Tensor
<TTo> destination = Tensor.CreateUninitialized<TTo>(source.Lengths);
3236
public static
Tensor
<TTo> ConvertSaturating<TFrom, TTo>(in ReadOnlyTensorSpan<TFrom> source)
3240
Tensor
<TTo> destination = Tensor.CreateUninitialized<TTo>(source.Lengths);
3267
public static
Tensor
<TTo> ConvertTruncating<TFrom, TTo>(in ReadOnlyTensorSpan<TFrom> source)
3271
Tensor
<TTo> destination = Tensor.CreateUninitialized<TTo>(source.Lengths);
3298
public static
Tensor
<T> CopySign<T>(in ReadOnlyTensorSpan<T> x, T sign)
3301
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
3307
/// 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.
3311
public static
Tensor
<T> CopySign<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> sign)
3314
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
3350
/// Takes the cosine of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
3353
public static
Tensor
<T> Cos<T>(in ReadOnlyTensorSpan<T> x)
3356
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
3377
/// Takes the hyperbolic cosine of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
3380
public static
Tensor
<T> Cosh<T>(in ReadOnlyTensorSpan<T> x)
3383
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
3419
/// <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>
3433
public static
Tensor
<T> CosPi<T>(in ReadOnlyTensorSpan<T> x)
3436
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
3470
public static
Tensor
<T> DegreesToRadians<T>(in ReadOnlyTensorSpan<T> x)
3473
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
3510
/// Divides each element of <paramref name="x"/> by <paramref name="y"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
3514
public static
Tensor
<T> Divide<T>(in ReadOnlyTensorSpan<T> x, T y)
3517
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
3523
/// Divides <paramref name="x"/> by each element of <paramref name="y"/> and returns a new <see cref="
Tensor
{T}"/> with the result."/>
3527
public static
Tensor
<T> Divide<T>(T x, in ReadOnlyTensorSpan<T> y)
3530
Tensor
<T> destination = Tensor.CreateUninitialized<T>(y.Lengths);
3541
public static
Tensor
<T> Divide<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
3544
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<T> destination);
3614
public static
Tensor
<T> Exp<T>(in ReadOnlyTensorSpan<T> x)
3617
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
3641
public static
Tensor
<T> Exp10<T>(in ReadOnlyTensorSpan<T> x)
3644
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
3666
public static
Tensor
<T> Exp10M1<T>(in ReadOnlyTensorSpan<T> x)
3669
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
3689
public static
Tensor
<T> Exp2<T>(in ReadOnlyTensorSpan<T> x)
3692
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
3712
public static
Tensor
<T> Exp2M1<T>(in ReadOnlyTensorSpan<T> x)
3715
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
3735
public static
Tensor
<T> ExpM1<T>(in ReadOnlyTensorSpan<T> x)
3738
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
3758
public static
Tensor
<T> Floor<T>(in ReadOnlyTensorSpan<T> x)
3761
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
3785
public static
Tensor
<T> Hypot<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
3788
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<T> destination);
3814
public static
Tensor
<T> Ieee754Remainder<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
3817
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<T> destination);
3838
public static
Tensor
<T> Ieee754Remainder<T>(in ReadOnlyTensorSpan<T> x, T y)
3841
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
3861
public static
Tensor
<T> Ieee754Remainder<T>(T x, in ReadOnlyTensorSpan<T> y)
3864
Tensor
<T> destination = Tensor.CreateUninitialized<T>(y.Lengths);
3885
public static
Tensor
<int> ILogB<T>(in ReadOnlyTensorSpan<T> x)
3888
Tensor
<int> destination = Tensor.CreateUninitialized<int>(x.Lengths);
3957
public static
Tensor
<T> LeadingZeroCount<T>(in ReadOnlyTensorSpan<T> x)
3960
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
3981
/// Takes the natural logarithm of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
3984
public static
Tensor
<T> Log<T>(in ReadOnlyTensorSpan<T> x)
3987
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
4008
public static
Tensor
<T> Log<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
4011
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<T> destination);
4031
public static
Tensor
<T> Log<T>(in ReadOnlyTensorSpan<T> x, T y)
4034
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
4054
/// 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.
4057
public static
Tensor
<T> Log10<T>(in ReadOnlyTensorSpan<T> x)
4060
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
4081
/// 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.
4084
public static
Tensor
<T> Log10P1<T>(in ReadOnlyTensorSpan<T> x)
4087
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
4108
/// 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.
4111
public static
Tensor
<T> Log2<T>(in ReadOnlyTensorSpan<T> x)
4114
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
4135
/// 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.
4138
public static
Tensor
<T> Log2P1<T>(in ReadOnlyTensorSpan<T> x)
4141
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
4162
/// 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.
4165
public static
Tensor
<T> LogP1<T>(in ReadOnlyTensorSpan<T> x)
4168
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
4206
public static
Tensor
<T> Max<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
4209
TensorOperation.ValidateCompatibility(in x, in y, out
Tensor
<T> output);
4229
public static
Tensor
<T> Max<T>(in ReadOnlyTensorSpan<T> x, T y)
4232
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
4269
public static
Tensor
<T> MaxMagnitude<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
4272
TensorOperation.ValidateCompatibility(in x, in y, out
Tensor
<T> destination);
4292
public static
Tensor
<T> MaxMagnitude<T>(in ReadOnlyTensorSpan<T> x, T y)
4295
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
4332
public static
Tensor
<T> MaxMagnitudeNumber<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
4335
TensorOperation.ValidateCompatibility(in x, in y, out
Tensor
<T> destination);
4355
public static
Tensor
<T> MaxMagnitudeNumber<T>(in ReadOnlyTensorSpan<T> x, T y)
4358
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
4395
public static
Tensor
<T> MaxNumber<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
4398
TensorOperation.ValidateCompatibility(in x, in y, out
Tensor
<T> destination);
4418
public static
Tensor
<T> MaxNumber<T>(in ReadOnlyTensorSpan<T> x, T y)
4421
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
4458
public static
Tensor
<T> Min<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
4461
TensorOperation.ValidateCompatibility(in x, in y, out
Tensor
<T> output);
4481
public static
Tensor
<T> Min<T>(in ReadOnlyTensorSpan<T> x, T y)
4484
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
4521
public static
Tensor
<T> MinMagnitude<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
4524
TensorOperation.ValidateCompatibility(in x, in y, out
Tensor
<T> destination);
4544
public static
Tensor
<T> MinMagnitude<T>(in ReadOnlyTensorSpan<T> x, T y)
4547
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
4584
public static
Tensor
<T> MinMagnitudeNumber<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
4587
TensorOperation.ValidateCompatibility(in x, in y, out
Tensor
<T> destination);
4607
public static
Tensor
<T> MinMagnitudeNumber<T>(in ReadOnlyTensorSpan<T> x, T y)
4610
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
4647
public static
Tensor
<T> MinNumber<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
4650
TensorOperation.ValidateCompatibility(in x, in y, out
Tensor
<T> destination);
4670
public static
Tensor
<T> MinNumber<T>(in ReadOnlyTensorSpan<T> x, T y)
4673
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
4693
/// Multiplies each element of <paramref name="x"/> with <paramref name="y"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
4697
public static
Tensor
<T> Multiply<T>(in ReadOnlyTensorSpan<T> x, T y)
4700
Tensor
<T> destination = Tensor.Create<T>(x.Lengths);
4706
/// Multiplies each element of <paramref name="x"/> with <paramref name="y"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
4711
public static
Tensor
<T> Multiply<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
4714
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<T> destination);
4752
public static
Tensor
<T> Negate<T>(in ReadOnlyTensorSpan<T> x)
4755
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
4789
public static
Tensor
<T> OnesComplement<T>(in ReadOnlyTensorSpan<T> x)
4792
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
4812
public static
Tensor
<T> PopCount<T>(in ReadOnlyTensorSpan<T> x)
4815
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
4836
public static
Tensor
<T> Pow<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
4839
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<T> destination);
4859
public static
Tensor
<T> Pow<T>(in ReadOnlyTensorSpan<T> x, T y)
4862
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
4882
public static
Tensor
<T> Pow<T>(T x, in ReadOnlyTensorSpan<T> y)
4885
Tensor
<T> destination = Tensor.CreateUninitialized<T>(y.Lengths);
4918
public static
Tensor
<T> RadiansToDegrees<T>(in ReadOnlyTensorSpan<T> x)
4921
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
4941
public static
Tensor
<T> Reciprocal<T>(in ReadOnlyTensorSpan<T> x)
4944
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
4965
public static
Tensor
<T> RootN<T>(in ReadOnlyTensorSpan<T> x, int n)
4968
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
4991
public static
Tensor
<T> RotateLeft<T>(in ReadOnlyTensorSpan<T> x, int rotateAmount)
4994
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
5018
public static
Tensor
<T> RotateRight<T>(in ReadOnlyTensorSpan<T> x, int rotateAmount)
5021
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
5043
public static
Tensor
<T> Round<T>(in ReadOnlyTensorSpan<T> x)
5046
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
5066
public static
Tensor
<T> Round<T>(in ReadOnlyTensorSpan<T> x, int digits, MidpointRounding mode)
5069
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
5090
public static
Tensor
<T> Round<T>(in ReadOnlyTensorSpan<T> x, int digits)
5093
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
5113
public static
Tensor
<T> Round<T>(in ReadOnlyTensorSpan<T> x, MidpointRounding mode)
5116
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
5137
public static
Tensor
<T> Sigmoid<T>(in ReadOnlyTensorSpan<T> x)
5140
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
5159
/// Takes the sin of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
5162
public static
Tensor
<T> Sin<T>(in ReadOnlyTensorSpan<T> x)
5165
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
5187
public static
Tensor
<T> Sinh<T>(in ReadOnlyTensorSpan<T> x)
5190
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
5210
public static
Tensor
<T> SinPi<T>(in ReadOnlyTensorSpan<T> x)
5213
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
5233
public static
Tensor
<T> SoftMax<T>(in ReadOnlyTensorSpan<T> x)
5239
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
5261
/// Takes the square root of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
5264
public static
Tensor
<T> Sqrt<T>(in ReadOnlyTensorSpan<T> x)
5267
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
5306
/// Subtracts <paramref name="y"/> from each element of <paramref name="x"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
5310
public static
Tensor
<T> Subtract<T>(in ReadOnlyTensorSpan<T> x, T y)
5313
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
5319
/// Subtracts each element of <paramref name="y"/> from <paramref name="x"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
5323
public static
Tensor
<T> Subtract<T>(T x, in ReadOnlyTensorSpan<T> y)
5326
Tensor
<T> destination = CreateUninitialized<T>(y.Lengths);
5332
/// Subtracts each element of <paramref name="x"/> from <paramref name="y"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
5336
public static
Tensor
<T> Subtract<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
5339
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<T> destination);
5420
public static
Tensor
<T> Tan<T>(in ReadOnlyTensorSpan<T> x)
5423
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
5443
public static
Tensor
<T> Tanh<T>(in ReadOnlyTensorSpan<T> x)
5446
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
5466
public static
Tensor
<T> TanPi<T>(in ReadOnlyTensorSpan<T> x)
5469
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
5489
public static
Tensor
<T> TrailingZeroCount<T>(in ReadOnlyTensorSpan<T> x)
5492
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
5512
public static
Tensor
<T> Truncate<T>(in ReadOnlyTensorSpan<T> x)
5515
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
5536
public static
Tensor
<T> Xor<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
5539
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<T> destination);
5557
/// Computes the element-wise Xor of the two input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
5561
public static
Tensor
<T> Xor<T>(in ReadOnlyTensorSpan<T> x, T y)
5564
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
System\Numerics\Tensors\netcore\Tensor_1.cs (26)
20
public sealed class Tensor<T> : ITensor<
Tensor
<T>, T>
23
public static
Tensor
<T> Empty { get; } = new();
138
public
Tensor
<T> this[params ReadOnlySpan<NRange> ranges]
171
public static implicit operator
Tensor
<T>(T[] array) => Tensor.Create(array);
176
public static implicit operator TensorSpan<T>(
Tensor
<T> tensor) => tensor.AsTensorSpan();
179
public static implicit operator ReadOnlyTensorSpan<T>(
Tensor
<T> tensor) => tensor.AsReadOnlyTensorSpan();
253
public
Tensor
<T> Slice(params ReadOnlySpan<nint> startIndexes)
269
public
Tensor
<T> Slice(params ReadOnlySpan<NIndex> startIndexes)
285
public
Tensor
<T> Slice(params ReadOnlySpan<NRange> ranges)
301
public
Tensor
<T> ToDenseTensor()
303
Tensor
<T> result = this;
324
/// <returns>A <see cref="string"/> representation of the <see cref="
Tensor
{T}"/></returns>
360
ref readonly T IReadOnlyTensor<
Tensor
<T>, T>.this[params ReadOnlySpan<nint> indexes] => ref this[indexes];
362
ref readonly T IReadOnlyTensor<
Tensor
<T>, T>.this[params ReadOnlySpan<NIndex> indexes] => ref this[indexes];
364
ReadOnlyTensorDimensionSpan<T> IReadOnlyTensor<
Tensor
<T>, T>.GetDimensionSpan(int dimension) => AsReadOnlyTensorSpan().GetDimensionSpan(dimension);
366
ref readonly T IReadOnlyTensor<
Tensor
<T>, T>.GetPinnableReference() => ref GetPinnableReference();
400
static
Tensor
<T> ITensor<
Tensor
<T>, T>.Create(scoped ReadOnlySpan<nint> lengths, bool pinned) => Tensor.Create<T>(lengths, pinned);
402
static
Tensor
<T> ITensor<
Tensor
<T>, T>.Create(scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides, bool pinned) => Tensor.Create<T>(lengths, strides, pinned);
404
static
Tensor
<T> ITensor<
Tensor
<T>, T>.CreateUninitialized(scoped ReadOnlySpan<nint> lengths, bool pinned) => Tensor.Create<T>(lengths, pinned);
406
static
Tensor
<T> ITensor<
Tensor
<T>, T>.CreateUninitialized(scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides, bool pinned) => Tensor.Create<T>(lengths, strides, pinned);
411
private readonly
Tensor
<T> _tensor;
416
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)