18 instantiations of Tensor
System.Numerics.Tensors (18)
System\Numerics\Tensors\netcore\Tensor.cs (14)
318
=> new
Tensor
<T>(lengths, strides: [], pinned);
323
=> new
Tensor
<T>(lengths, strides, pinned);
328
=> new
Tensor
<T>(array);
333
=> new
Tensor
<T>(array, lengths);
338
=> new
Tensor
<T>(array, lengths, strides);
343
=> new
Tensor
<T>(array, start, lengths, strides);
439
return new
Tensor
<T>(array, in shape, pinned);
447
return new
Tensor
<T>(values, in shape, pinned);
1419
outTensor = new
Tensor
<T>(tensor._values, tensor._start, newLengths, newStrides, newLinearOrder);
1501
return new
Tensor
<T>(tensor._values, tensor._start, lengths, strides);
1888
outputs[i] = new
Tensor
<T>(values, 0, newShape, [], tensor._shape.LinearRankOrder);
1973
Tensor<T> output = new
Tensor
<T>(tensor._values, tensor._start, lengths[..newRank], strides[..newRank], strideOrder[..newRank]);
2377
Tensor<T> output = new
Tensor
<T>(tensor._values, tensor._start, lengths, strides, strideOrder);
2459
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
();
257
return new
Tensor
<T>(
273
return new
Tensor
<T>(
289
return new
Tensor
<T>(
482 references to Tensor
System.Numerics.Tensors (482)
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);
317
public static
Tensor
<T> Create<T>(scoped ReadOnlySpan<nint> lengths, bool pinned = false)
322
public static
Tensor
<T> Create<T>(scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides, bool pinned = false)
327
public static
Tensor
<T> Create<T>(T[] array)
332
public static
Tensor
<T> Create<T>(T[] array, scoped ReadOnlySpan<nint> lengths)
337
public static
Tensor
<T> Create<T>(T[] array, scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides)
342
public static
Tensor
<T> Create<T>(T[] array, int start, scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides)
346
public static
Tensor
<T> Create<T>(IEnumerable<T> enumerable, bool pinned = false)
352
Tensor
<T> tensor = CreateUninitialized<T>([array.Length], pinned);
365
public static
Tensor
<T> Create<T>(IEnumerable<T> enumerable, scoped ReadOnlySpan<nint> lengths, bool pinned = false)
370
public static
Tensor
<T> Create<T>(IEnumerable<T> enumerable, scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides, bool pinned = false)
376
Tensor
<T> tensor = CreateUninitialized<T>(lengths, strides, pinned);
388
/// Creates a <see cref="
Tensor
{T}"/> and initializes it with random data in a gaussian normal distribution.
391
public static
Tensor
<T> CreateAndFillGaussianNormalDistribution<T>(scoped ReadOnlySpan<nint> lengths)
398
/// Creates a <see cref="
Tensor
{T}"/> and initializes it with random data in a gaussian normal distribution.
402
public static
Tensor
<T> CreateAndFillGaussianNormalDistribution<T>(Random random, scoped ReadOnlySpan<nint> lengths)
405
Tensor
<T> tensor = CreateUninitialized<T>(lengths);
412
/// Creates a <see cref="
Tensor
{T}"/> and initializes it with random data uniformly distributed.
415
public static
Tensor
<T> CreateAndFillUniformDistribution<T>(scoped ReadOnlySpan<nint> lengths)
422
/// Creates a <see cref="
Tensor
{T}"/> and initializes it with random data uniformly distributed.
426
public static
Tensor
<T> CreateAndFillUniformDistribution<T>(Random random, scoped ReadOnlySpan<nint> lengths)
429
Tensor
<T> tensor = CreateUninitialized<T>(lengths);
435
public static
Tensor
<T> CreateUninitialized<T>(scoped ReadOnlySpan<nint> lengths, bool pinned = false)
443
public static
Tensor
<T> CreateUninitialized<T>(scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides, bool pinned = false)
502
public static
Tensor
<bool> Equals<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
505
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<bool> destination);
533
public static
Tensor
<bool> Equals<T>(in ReadOnlyTensorSpan<T> x, T y)
536
Tensor
<bool> destination = CreateUninitialized<bool>(x.Lengths);
622
/// <param name="tensor">Input <see cref="
Tensor
{T}"/>.</param>
636
/// <param name="tensor">Input <see cref="
Tensor
{T}"/>.</param>
651
/// 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"/>
656
/// <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
658
public static
Tensor
<bool> GreaterThan<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
661
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<bool> destination);
669
/// 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>A <see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/> and
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"/>
692
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/>
694
public static
Tensor
<bool> GreaterThan<T>(in ReadOnlyTensorSpan<T> x, T y)
697
Tensor
<bool> destination = Tensor.Create<bool>(x.Lengths, false);
704
/// 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"/>
722
/// 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"/>
727
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/>
729
public static
Tensor
<bool> GreaterThan<T>(T x, in ReadOnlyTensorSpan<T> y)
734
/// 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"/>
740
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/>
832
/// 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"/>
837
/// <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
839
public static
Tensor
<bool> GreaterThanOrEqual<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
842
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<bool> destination);
850
/// 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>A <see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/> and
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"/>
873
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/>
875
public static
Tensor
<bool> GreaterThanOrEqual<T>(in ReadOnlyTensorSpan<T> x, T y)
878
Tensor
<bool> destination = Tensor.Create<bool>(x.Lengths, false);
885
/// 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"/>
903
/// 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"/>
908
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/>
910
public static
Tensor
<bool> GreaterThanOrEqual<T>(T x, in ReadOnlyTensorSpan<T> y)
915
/// 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"/>
921
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/>
1013
/// 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"/>
1018
/// <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
1020
public static
Tensor
<bool> LessThan<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
1023
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<bool> destination);
1031
/// 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"/>
1037
/// <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
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>
1054
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/>
1056
public static
Tensor
<bool> LessThan<T>(in ReadOnlyTensorSpan<T> x, T y)
1059
Tensor
<bool> destination = Tensor.Create<bool>(x.Lengths, false);
1065
/// Compares the elements of a <see cref="
Tensor
{T}"/> to see which elements are less than <paramref name="y"/>.
1066
/// 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"/>
1069
/// <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"/>
1083
/// Compares the elements of a <see cref="
Tensor
{T}"/> to see which elements are less than <paramref name="y"/>.
1084
/// 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"/>
1087
/// <param name="x"><see cref="
Tensor
{T}"/> to compare.</param>
1089
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/>
1091
public static
Tensor
<bool> LessThan<T>(T x, in ReadOnlyTensorSpan<T> y)
1095
/// Compares the elements of a <see cref="
Tensor
{T}"/> to see which elements are less than <paramref name="y"/>.
1096
/// 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"/>
1099
/// <param name="x"><see cref="
Tensor
{T}"/> to compare.</param>
1102
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/>
1194
/// 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"/>
1199
/// <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
1201
public static
Tensor
<bool> LessThanOrEqual<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
1204
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<bool> destination);
1212
/// 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"/>
1218
/// <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
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>
1235
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/>
1237
public static
Tensor
<bool> LessThanOrEqual<T>(in ReadOnlyTensorSpan<T> x, T y)
1240
Tensor
<bool> destination = Tensor.Create<bool>(x.Lengths, false);
1246
/// Compares the elements of a <see cref="
Tensor
{T}"/> to see which elements are less than <paramref name="y"/>.
1247
/// 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"/>
1250
/// <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"/>
1264
/// Compares the elements of a <see cref="
Tensor
{T}"/> to see which elements are less than <paramref name="y"/>.
1265
/// 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"/>
1268
/// <param name="x"><see cref="
Tensor
{T}"/> to compare.</param>
1270
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/>
1272
public static
Tensor
<bool> LessThanOrEqual<T>(T x, in ReadOnlyTensorSpan<T> y)
1276
/// Compares the elements of a <see cref="
Tensor
{T}"/> to see which elements are less than <paramref name="y"/>.
1277
/// 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"/>
1280
/// <param name="x"><see cref="
Tensor
{T}"/> to compare.</param>
1283
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/>
1375
/// If <paramref name="tensor"/> is a 1D tensor, it will return <paramref name="tensor"/>. Otherwise it creates a new <see cref="
Tensor
{T}"/>
1378
/// <param name="tensor">Input <see cref="
Tensor
{T}"/></param>
1380
public static
Tensor
<T> PermuteDimensions<T>(this
Tensor
<T> tensor, ReadOnlySpan<int> dimensions)
1395
Tensor
<T> outTensor;
1436
/// <param name="tensor"><see cref="
Tensor
{T}"/> you want to reshape.</param>
1438
public static
Tensor
<T> Reshape<T>(this
Tensor
<T> tensor, ReadOnlySpan<nint> lengths)
1658
/// 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
1661
/// <param name="tensor">Input <see cref="
Tensor
{T}"/>.</param>
1663
public static
Tensor
<T> Resize<T>(
Tensor
<T> tensor, ReadOnlySpan<nint> lengths)
1667
Tensor
<T> output = Tensor.Create(values, 0, lengths, []);
1682
/// <param name="tensor">Input <see cref="
Tensor
{T}"/>.</param>
1684
public static void ResizeTo<T>(scoped in
Tensor
<T> tensor, in TensorSpan<T> destination)
1721
/// <param name="tensor">Input <see cref="
Tensor
{T}"/>.</param>
1722
public static
Tensor
<T> Reverse<T>(in ReadOnlyTensorSpan<T> tensor)
1724
Tensor
<T> output = Tensor.Create<T>(tensor.Lengths);
1734
/// <param name="tensor">Input <see cref="
Tensor
{T}"/>.</param>
1736
public static
Tensor
<T> ReverseDimension<T>(in ReadOnlyTensorSpan<T> tensor, int dimension)
1738
Tensor
<T> output = Tensor.Create<T>(tensor.Lengths);
1826
/// <param name="tensor">Input <see cref="
Tensor
{T}"/>.</param>
1829
public static
Tensor
<T> SetSlice<T>(this
Tensor
<T> tensor, in ReadOnlyTensorSpan<T> values, params ReadOnlySpan<NRange> ranges)
1838
/// <param name="tensor">Input <see cref="
Tensor
{T}"/>.</param>
1857
/// Split a <see cref="
Tensor
{T}"/> into <paramref name="splitCount"/> along the given <paramref name="dimension"/>. If the tensor cannot be split
1860
/// <param name="tensor">Input <see cref="
Tensor
{T}"/>.</param>
1863
public static
Tensor
<T>[] Split<T>(scoped in ReadOnlyTensorSpan<T> tensor, int splitCount, nint dimension)
1870
Tensor
<T>[] outputs = new
Tensor
<T>[splitCount];
1903
/// <param name="tensor">The <see cref="
Tensor
{T}"/> to remove all dimensions of length 1.</param>
1904
public static
Tensor
<T> Squeeze<T>(this
Tensor
<T> tensor)
1913
/// <param name="tensor">The <see cref="
Tensor
{T}"/> to remove dimension of length 1.</param>
1915
public static
Tensor
<T> SqueezeDimension<T>(this
Tensor
<T> tensor, int dimension)
1973
Tensor
<T> output = new Tensor<T>(tensor._values, tensor._start, lengths[..newRank], strides[..newRank], strideOrder[..newRank]);
2174
/// Join multiple <see cref="
Tensor
{T}"/> along a new dimension that is added at position 0. All tensors must have the same shape.
2176
/// <param name="tensors">Input <see cref="
Tensor
{T}"/>.</param>
2177
public static
Tensor
<T> Stack<T>(params ReadOnlySpan<
Tensor
<T>> tensors)
2183
/// 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.
2185
/// <param name="tensors">Input <see cref="
Tensor
{T}"/>.</param>
2187
public static
Tensor
<T> StackAlongDimension<T>(int dimension, params ReadOnlySpan<
Tensor
<T>> tensors)
2203
Tensor
<T>[] outputs = new
Tensor
<T>[tensors.Length];
2212
/// Join multiple <see cref="
Tensor
{T}"/> along a new dimension that is added at position 0. All tensors must have the same shape.
2214
/// <param name="tensors">Input <see cref="
Tensor
{T}"/>.</param>
2216
public static ref readonly TensorSpan<T> Stack<T>(scoped in ReadOnlySpan<
Tensor
<T>> tensors, in TensorSpan<T> destination)
2222
/// 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.
2224
/// <param name="tensors">Input <see cref="
Tensor
{T}"/>.</param>
2227
public static ref readonly TensorSpan<T> StackAlongDimension<T>(scoped ReadOnlySpan<
Tensor
<T>> tensors, in TensorSpan<T> destination, int dimension)
2243
Tensor
<T>[] outputs = new
Tensor
<T>[tensors.Length];
2337
/// Creates a <see cref="string"/> representation of the <see cref="
Tensor
{T}"/>."/>
2342
public static string ToString<T>(this
Tensor
<T> tensor, ReadOnlySpan<nint> maximumLengths)
2351
/// <param name="tensor">Input <see cref="
Tensor
{T}"/>.</param>
2352
public static
Tensor
<T> Transpose<T>(
Tensor
<T> tensor)
2377
Tensor
<T> output = new Tensor<T>(tensor._values, tensor._start, lengths, strides, strideOrder);
2392
/// <param name="tensor">Input <see cref="
Tensor
{T}"/>.</param>
2394
public static bool TryBroadcastTo<T>(this
Tensor
<T> tensor, in TensorSpan<T> destination)
2431
/// <param name="tensor">The <see cref="
Tensor
{T}"/> to add a dimension of length 1.</param>
2433
public static
Tensor
<T> Unsqueeze<T>(this
Tensor
<T> tensor, int dimension)
2459
Tensor
<T> output = new Tensor<T>(tensor._values, tensor._start, newLengths, newStrides);
2543
/// Takes the absolute value of each element of the <see cref="
Tensor
{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
2546
public static
Tensor
<T> Abs<T>(in ReadOnlyTensorSpan<T> x)
2549
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
2570
/// Takes the inverse cosine of each element of the <see cref="
Tensor
{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
2573
public static
Tensor
<T> Acos<T>(in ReadOnlyTensorSpan<T> x)
2576
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
2582
/// Takes the inverse cosine of each element of the <see cref="
Tensor
{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
2597
/// 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.
2600
public static
Tensor
<T> Acosh<T>(in ReadOnlyTensorSpan<T> x)
2603
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
2624
/// 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.
2627
public static
Tensor
<T> AcosPi<T>(in ReadOnlyTensorSpan<T> x)
2630
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
2651
/// 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.
2655
public static
Tensor
<T> Add<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
2658
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<T> destination);
2664
/// Adds <paramref name="y"/> to each element of <paramref name="x"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
2668
public static
Tensor
<T> Add<T>(in ReadOnlyTensorSpan<T> x, T y)
2671
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
2707
/// Takes the inverse sin of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
2710
public static
Tensor
<T> Asin<T>(in ReadOnlyTensorSpan<T> x)
2713
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
2734
/// 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.
2737
public static
Tensor
<T> Asinh<T>(in ReadOnlyTensorSpan<T> x)
2740
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
2761
/// 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.
2764
public static
Tensor
<T> AsinPi<T>(in ReadOnlyTensorSpan<T> x)
2767
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
2788
/// Takes the arc tangent of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
2791
public static
Tensor
<T> Atan<T>(in ReadOnlyTensorSpan<T> x)
2794
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
2815
/// Takes the arc tangent of the two input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
2819
public static
Tensor
<T> Atan2<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
2822
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
2842
/// Takes the arc tangent of the two input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
2846
public static
Tensor
<T> Atan2<T>(in ReadOnlyTensorSpan<T> x, T y)
2849
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
2869
/// Takes the arc tangent of the two input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
2873
public static
Tensor
<T> Atan2<T>(T x, in ReadOnlyTensorSpan<T> y)
2876
Tensor
<T> destination = Tensor.CreateUninitialized<T>(y.Lengths);
2898
/// 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.
2902
public static
Tensor
<T> Atan2Pi<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
2905
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
2929
public static
Tensor
<T> Atan2Pi<T>(in ReadOnlyTensorSpan<T> x, T y)
2932
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
2956
public static
Tensor
<T> Atan2Pi<T>(T x, in ReadOnlyTensorSpan<T> y)
2959
Tensor
<T> destination = Tensor.CreateUninitialized<T>(y.Lengths);
2981
/// 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.
2984
public static
Tensor
<T> Atanh<T>(in ReadOnlyTensorSpan<T> x)
2987
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
3008
/// 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.
3011
public static
Tensor
<T> AtanPi<T>(in ReadOnlyTensorSpan<T> x)
3014
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
3052
/// 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.
3056
public static
Tensor
<T> BitwiseAnd<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
3059
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
3079
/// 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.
3083
public static
Tensor
<T> BitwiseAnd<T>(in ReadOnlyTensorSpan<T> x, T y)
3086
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
3108
/// 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.
3112
public static
Tensor
<T> BitwiseOr<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
3115
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
3135
/// 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.
3139
public static
Tensor
<T> BitwiseOr<T>(in ReadOnlyTensorSpan<T> x, T y)
3142
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
3164
/// Computes the element-wise cube root of the input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
3167
public static
Tensor
<T> Cbrt<T>(in ReadOnlyTensorSpan<T> x)
3170
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
3191
/// Computes the element-wise ceiling of the input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
3194
public static
Tensor
<T> Ceiling<T>(in ReadOnlyTensorSpan<T> x)
3197
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
3222
public static
Tensor
<TTo> ConvertChecked<TFrom, TTo>(in ReadOnlyTensorSpan<TFrom> source)
3226
Tensor
<TTo> destination = Tensor.CreateUninitialized<TTo>(source.Lengths);
3253
public static
Tensor
<TTo> ConvertSaturating<TFrom, TTo>(in ReadOnlyTensorSpan<TFrom> source)
3257
Tensor
<TTo> destination = Tensor.CreateUninitialized<TTo>(source.Lengths);
3284
public static
Tensor
<TTo> ConvertTruncating<TFrom, TTo>(in ReadOnlyTensorSpan<TFrom> source)
3288
Tensor
<TTo> destination = Tensor.CreateUninitialized<TTo>(source.Lengths);
3315
public static
Tensor
<T> CopySign<T>(in ReadOnlyTensorSpan<T> x, T sign)
3318
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
3324
/// 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.
3328
public static
Tensor
<T> CopySign<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> sign)
3331
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
3367
/// Takes the cosine of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
3370
public static
Tensor
<T> Cos<T>(in ReadOnlyTensorSpan<T> x)
3373
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
3394
/// Takes the hyperbolic cosine of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
3397
public static
Tensor
<T> Cosh<T>(in ReadOnlyTensorSpan<T> x)
3400
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
3436
/// <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>
3450
public static
Tensor
<T> CosPi<T>(in ReadOnlyTensorSpan<T> x)
3453
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
3487
public static
Tensor
<T> DegreesToRadians<T>(in ReadOnlyTensorSpan<T> x)
3490
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
3527
/// Divides each element of <paramref name="x"/> by <paramref name="y"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
3531
public static
Tensor
<T> Divide<T>(in ReadOnlyTensorSpan<T> x, T y)
3534
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
3540
/// Divides <paramref name="x"/> by each element of <paramref name="y"/> and returns a new <see cref="
Tensor
{T}"/> with the result."/>
3544
public static
Tensor
<T> Divide<T>(T x, in ReadOnlyTensorSpan<T> y)
3547
Tensor
<T> destination = Tensor.CreateUninitialized<T>(y.Lengths);
3558
public static
Tensor
<T> Divide<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
3561
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<T> destination);
3631
public static
Tensor
<T> Exp<T>(in ReadOnlyTensorSpan<T> x)
3634
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
3658
public static
Tensor
<T> Exp10<T>(in ReadOnlyTensorSpan<T> x)
3661
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
3683
public static
Tensor
<T> Exp10M1<T>(in ReadOnlyTensorSpan<T> x)
3686
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
3706
public static
Tensor
<T> Exp2<T>(in ReadOnlyTensorSpan<T> x)
3709
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
3729
public static
Tensor
<T> Exp2M1<T>(in ReadOnlyTensorSpan<T> x)
3732
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
3752
public static
Tensor
<T> ExpM1<T>(in ReadOnlyTensorSpan<T> x)
3755
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
3775
public static
Tensor
<T> Floor<T>(in ReadOnlyTensorSpan<T> x)
3778
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
3802
public static
Tensor
<T> Hypot<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
3805
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<T> destination);
3831
public static
Tensor
<T> Ieee754Remainder<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
3834
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<T> destination);
3855
public static
Tensor
<T> Ieee754Remainder<T>(in ReadOnlyTensorSpan<T> x, T y)
3858
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
3878
public static
Tensor
<T> Ieee754Remainder<T>(T x, in ReadOnlyTensorSpan<T> y)
3881
Tensor
<T> destination = Tensor.CreateUninitialized<T>(y.Lengths);
3902
public static
Tensor
<int> ILogB<T>(in ReadOnlyTensorSpan<T> x)
3905
Tensor
<int> destination = Tensor.CreateUninitialized<int>(x.Lengths);
3974
public static
Tensor
<T> LeadingZeroCount<T>(in ReadOnlyTensorSpan<T> x)
3977
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
3998
/// Takes the natural logarithm of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
4001
public static
Tensor
<T> Log<T>(in ReadOnlyTensorSpan<T> x)
4004
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
4025
public static
Tensor
<T> Log<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
4028
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<T> destination);
4048
public static
Tensor
<T> Log<T>(in ReadOnlyTensorSpan<T> x, T y)
4051
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
4071
/// 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.
4074
public static
Tensor
<T> Log10<T>(in ReadOnlyTensorSpan<T> x)
4077
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
4098
/// 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.
4101
public static
Tensor
<T> Log10P1<T>(in ReadOnlyTensorSpan<T> x)
4104
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
4125
/// 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.
4128
public static
Tensor
<T> Log2<T>(in ReadOnlyTensorSpan<T> x)
4131
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
4152
/// 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.
4155
public static
Tensor
<T> Log2P1<T>(in ReadOnlyTensorSpan<T> x)
4158
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
4179
/// 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.
4182
public static
Tensor
<T> LogP1<T>(in ReadOnlyTensorSpan<T> x)
4185
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
4223
public static
Tensor
<T> Max<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
4226
TensorOperation.ValidateCompatibility(in x, in y, out
Tensor
<T> output);
4246
public static
Tensor
<T> Max<T>(in ReadOnlyTensorSpan<T> x, T y)
4249
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
4286
public static
Tensor
<T> MaxMagnitude<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
4289
TensorOperation.ValidateCompatibility(in x, in y, out
Tensor
<T> destination);
4309
public static
Tensor
<T> MaxMagnitude<T>(in ReadOnlyTensorSpan<T> x, T y)
4312
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
4349
public static
Tensor
<T> MaxMagnitudeNumber<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
4352
TensorOperation.ValidateCompatibility(in x, in y, out
Tensor
<T> destination);
4372
public static
Tensor
<T> MaxMagnitudeNumber<T>(in ReadOnlyTensorSpan<T> x, T y)
4375
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
4412
public static
Tensor
<T> MaxNumber<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
4415
TensorOperation.ValidateCompatibility(in x, in y, out
Tensor
<T> destination);
4435
public static
Tensor
<T> MaxNumber<T>(in ReadOnlyTensorSpan<T> x, T y)
4438
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
4475
public static
Tensor
<T> Min<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
4478
TensorOperation.ValidateCompatibility(in x, in y, out
Tensor
<T> output);
4498
public static
Tensor
<T> Min<T>(in ReadOnlyTensorSpan<T> x, T y)
4501
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
4538
public static
Tensor
<T> MinMagnitude<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
4541
TensorOperation.ValidateCompatibility(in x, in y, out
Tensor
<T> destination);
4561
public static
Tensor
<T> MinMagnitude<T>(in ReadOnlyTensorSpan<T> x, T y)
4564
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
4601
public static
Tensor
<T> MinMagnitudeNumber<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
4604
TensorOperation.ValidateCompatibility(in x, in y, out
Tensor
<T> destination);
4624
public static
Tensor
<T> MinMagnitudeNumber<T>(in ReadOnlyTensorSpan<T> x, T y)
4627
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
4664
public static
Tensor
<T> MinNumber<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
4667
TensorOperation.ValidateCompatibility(in x, in y, out
Tensor
<T> destination);
4687
public static
Tensor
<T> MinNumber<T>(in ReadOnlyTensorSpan<T> x, T y)
4690
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
4710
/// Multiplies each element of <paramref name="x"/> with <paramref name="y"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
4714
public static
Tensor
<T> Multiply<T>(in ReadOnlyTensorSpan<T> x, T y)
4717
Tensor
<T> destination = Tensor.Create<T>(x.Lengths);
4723
/// Multiplies each element of <paramref name="x"/> with <paramref name="y"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
4728
public static
Tensor
<T> Multiply<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
4731
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<T> destination);
4769
public static
Tensor
<T> Negate<T>(in ReadOnlyTensorSpan<T> x)
4772
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
4806
public static
Tensor
<T> OnesComplement<T>(in ReadOnlyTensorSpan<T> x)
4809
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
4829
public static
Tensor
<T> PopCount<T>(in ReadOnlyTensorSpan<T> x)
4832
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
4853
public static
Tensor
<T> Pow<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
4856
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<T> destination);
4876
public static
Tensor
<T> Pow<T>(in ReadOnlyTensorSpan<T> x, T y)
4879
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
4899
public static
Tensor
<T> Pow<T>(T x, in ReadOnlyTensorSpan<T> y)
4902
Tensor
<T> destination = Tensor.CreateUninitialized<T>(y.Lengths);
4935
public static
Tensor
<T> RadiansToDegrees<T>(in ReadOnlyTensorSpan<T> x)
4938
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
4958
public static
Tensor
<T> Reciprocal<T>(in ReadOnlyTensorSpan<T> x)
4961
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
4982
public static
Tensor
<T> RootN<T>(in ReadOnlyTensorSpan<T> x, int n)
4985
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
5008
public static
Tensor
<T> RotateLeft<T>(in ReadOnlyTensorSpan<T> x, int rotateAmount)
5011
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
5035
public static
Tensor
<T> RotateRight<T>(in ReadOnlyTensorSpan<T> x, int rotateAmount)
5038
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
5060
public static
Tensor
<T> Round<T>(in ReadOnlyTensorSpan<T> x)
5063
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
5083
public static
Tensor
<T> Round<T>(in ReadOnlyTensorSpan<T> x, int digits, MidpointRounding mode)
5086
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
5107
public static
Tensor
<T> Round<T>(in ReadOnlyTensorSpan<T> x, int digits)
5110
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
5130
public static
Tensor
<T> Round<T>(in ReadOnlyTensorSpan<T> x, MidpointRounding mode)
5133
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
5154
public static
Tensor
<T> Sigmoid<T>(in ReadOnlyTensorSpan<T> x)
5157
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
5176
/// Takes the sin of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
5179
public static
Tensor
<T> Sin<T>(in ReadOnlyTensorSpan<T> x)
5182
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
5204
public static
Tensor
<T> Sinh<T>(in ReadOnlyTensorSpan<T> x)
5207
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
5227
public static
Tensor
<T> SinPi<T>(in ReadOnlyTensorSpan<T> x)
5230
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
5250
public static
Tensor
<T> SoftMax<T>(in ReadOnlyTensorSpan<T> x)
5256
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
5278
/// Takes the square root of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
5281
public static
Tensor
<T> Sqrt<T>(in ReadOnlyTensorSpan<T> x)
5284
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
5323
/// Subtracts <paramref name="y"/> from each element of <paramref name="x"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
5327
public static
Tensor
<T> Subtract<T>(in ReadOnlyTensorSpan<T> x, T y)
5330
Tensor
<T> destination = CreateUninitialized<T>(x.Lengths);
5336
/// Subtracts each element of <paramref name="y"/> from <paramref name="x"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
5340
public static
Tensor
<T> Subtract<T>(T x, in ReadOnlyTensorSpan<T> y)
5343
Tensor
<T> destination = CreateUninitialized<T>(y.Lengths);
5349
/// Subtracts each element of <paramref name="x"/> from <paramref name="y"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
5353
public static
Tensor
<T> Subtract<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
5356
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<T> destination);
5437
public static
Tensor
<T> Tan<T>(in ReadOnlyTensorSpan<T> x)
5440
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
5460
public static
Tensor
<T> Tanh<T>(in ReadOnlyTensorSpan<T> x)
5463
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
5483
public static
Tensor
<T> TanPi<T>(in ReadOnlyTensorSpan<T> x)
5486
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
5506
public static
Tensor
<T> TrailingZeroCount<T>(in ReadOnlyTensorSpan<T> x)
5509
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
5529
public static
Tensor
<T> Truncate<T>(in ReadOnlyTensorSpan<T> x)
5532
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
5553
public static
Tensor
<T> Xor<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
5556
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<T> destination);
5574
/// Computes the element-wise Xor of the two input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
5578
public static
Tensor
<T> Xor<T>(in ReadOnlyTensorSpan<T> x, T y)
5581
Tensor
<T> destination = Tensor.CreateUninitialized<T>(x.Lengths);
System\Numerics\Tensors\netcore\Tensor_1.cs (25)
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();
250
public
Tensor
<T> Slice(params ReadOnlySpan<nint> startIndexes)
266
public
Tensor
<T> Slice(params ReadOnlySpan<NIndex> startIndexes)
282
public
Tensor
<T> Slice(params ReadOnlySpan<NRange> ranges)
298
public
Tensor
<T> ToDenseTensor()
300
Tensor
<T> result = this;
321
/// <returns>A <see cref="string"/> representation of the <see cref="
Tensor
{T}"/></returns>
357
ref readonly T IReadOnlyTensor<
Tensor
<T>, T>.this[params ReadOnlySpan<nint> indexes] => ref this[indexes];
359
ref readonly T IReadOnlyTensor<
Tensor
<T>, T>.this[params ReadOnlySpan<NIndex> indexes] => ref this[indexes];
362
ref readonly T IReadOnlyTensor<
Tensor
<T>, T>.GetPinnableReference() => ref GetPinnableReference();
396
static
Tensor
<T> ITensor<
Tensor
<T>, T>.Create(scoped ReadOnlySpan<nint> lengths, bool pinned) => Tensor.Create<T>(lengths, pinned);
398
static
Tensor
<T> ITensor<
Tensor
<T>, T>.Create(scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides, bool pinned) => Tensor.Create<T>(lengths, strides, pinned);
400
static
Tensor
<T> ITensor<
Tensor
<T>, T>.CreateUninitialized(scoped ReadOnlySpan<nint> lengths, bool pinned) => Tensor.Create<T>(lengths, pinned);
402
static
Tensor
<T> ITensor<
Tensor
<T>, T>.CreateUninitialized(scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides, bool pinned) => Tensor.Create<T>(lengths, strides, pinned);
407
private readonly
Tensor
<T> _tensor;
412
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)