17 instantiations of Tensor
System.Numerics.Tensors (17)
System\Numerics\Tensors\netcore\Tensor.cs (13)
297
=> new
Tensor
<T>(array);
302
=> new
Tensor
<T>(array, lengths, strides: []);
307
=> new
Tensor
<T>(array, lengths, strides);
312
=> new
Tensor
<T>(array, start, lengths, strides);
319
=> new
Tensor
<T>(lengths, strides: [], pinned);
324
=> new
Tensor
<T>(lengths, strides, pinned);
335
return new
Tensor
<T>(values, in shape);
1304
outTensor = new
Tensor
<T>(tensor._values, tensor._start, newLengths, newStrides);
1385
return new
Tensor
<T>(tensor._values, tensor._start, lengths, strides);
1772
outputs[i] = new
Tensor
<T>(values, newLengths, strides: []);
1843
Tensor<T> output = new
Tensor
<T>(tensor._values, tensor._start, lengths[..rank], strides[..rank]);
2185
Tensor<T> output = new
Tensor
<T>(tensor._values, tensor._start, lengths, strides);
2266
Tensor<T> output = new
Tensor
<T>(tensor._values, tensor._start, newLengths, newStrides);
System\Numerics\Tensors\netcore\Tensor_1.cs (4)
21
public static Tensor<T> Empty { get; } =
new
();
222
return new
Tensor
<T>(
237
return new
Tensor
<T>(
252
return new
Tensor
<T>(
472 references to Tensor
System.Numerics.Tensors (472)
System\Numerics\Tensors\netcore\ReadOnlyTensorSpan_1.cs (1)
520
Tensor
<T> tmp = Tensor.CreateFromShape<T>(Lengths, IsPinned);
System\Numerics\Tensors\netcore\Tensor.cs (441)
51
/// 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.
53
/// <param name="source">Input <see cref="
Tensor
{T}"/>.</param>
54
/// <param name="lengthsSource">Other <see cref="
Tensor
{T}"/> to make shapes broadcastable.</param>
55
public static
Tensor
<T> Broadcast<T>(scoped in ReadOnlyTensorSpan<T> source, scoped in ReadOnlyTensorSpan<T> lengthsSource)
61
/// 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.
64
/// <param name="source">Input <see cref="
Tensor
{T}"/>.</param>
67
public static
Tensor
<T> Broadcast<T>(scoped in ReadOnlyTensorSpan<T> source, scoped ReadOnlySpan<nint> lengths)
70
Tensor
<T> destination = CreateFromShapeUninitialized<T>(lengths);
82
public static void BroadcastTo<T>(this
Tensor
<T> source, in TensorSpan<T> destination)
116
public static
Tensor
<T> Concatenate<T>(params scoped ReadOnlySpan<
Tensor
<T>> tensors)
126
public static
Tensor
<T> ConcatenateOnDimension<T>(int dimension, params scoped ReadOnlySpan<
Tensor
<T>> tensors)
134
Tensor
<T> tensor;
187
public static ref readonly TensorSpan<T> Concatenate<T>(scoped ReadOnlySpan<
Tensor
<T>> tensors, in TensorSpan<T> destination)
199
public static ref readonly TensorSpan<T> ConcatenateOnDimension<T>(int dimension, scoped ReadOnlySpan<
Tensor
<T>> tensors, in TensorSpan<T> destination)
267
Tensor
<T> slice = tensors[i].Slice(ranges);
296
public static
Tensor
<T> Create<T>(T[] array)
301
public static
Tensor
<T> Create<T>(T[] array, scoped ReadOnlySpan<nint> lengths)
306
public static
Tensor
<T> Create<T>(T[] array, scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides)
311
public static
Tensor
<T> Create<T>(T[] array, int start, scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides)
318
public static
Tensor
<T> CreateFromShape<T>(scoped ReadOnlySpan<nint> lengths, bool pinned = false)
323
public static
Tensor
<T> CreateFromShape<T>(scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides, bool pinned = false)
327
public static
Tensor
<T> CreateFromShapeUninitialized<T>(scoped ReadOnlySpan<nint> lengths, bool pinned = false)
331
public static
Tensor
<T> CreateFromShapeUninitialized<T>(scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides, bool pinned = false)
390
public static
Tensor
<bool> Equals<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
393
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<bool> destination);
421
public static
Tensor
<bool> Equals<T>(in ReadOnlyTensorSpan<T> x, T y)
424
Tensor
<bool> destination = CreateFromShapeUninitialized<bool>(x.Lengths);
510
/// <param name="tensor">Input <see cref="
Tensor
{T}"/>.</param>
524
/// <param name="tensor">Input <see cref="
Tensor
{T}"/>.</param>
539
/// 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"/>
544
/// <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
546
public static
Tensor
<bool> GreaterThan<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
549
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<bool> destination);
557
/// 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"/>
563
/// <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
575
/// 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"/>
580
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/>
582
public static
Tensor
<bool> GreaterThan<T>(in ReadOnlyTensorSpan<T> x, T y)
585
Tensor
<bool> destination = CreateFromShape<bool>(x.Lengths, false);
592
/// 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"/>
598
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/>
610
/// 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"/>
615
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/>
617
public static
Tensor
<bool> GreaterThan<T>(T x, in ReadOnlyTensorSpan<T> y)
622
/// 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"/>
628
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/>
720
/// 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"/>
725
/// <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
727
public static
Tensor
<bool> GreaterThanOrEqual<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
730
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<bool> destination);
738
/// 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"/>
744
/// <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
756
/// 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"/>
761
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/>
763
public static
Tensor
<bool> GreaterThanOrEqual<T>(in ReadOnlyTensorSpan<T> x, T y)
766
Tensor
<bool> destination = CreateFromShape<bool>(x.Lengths, false);
773
/// 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"/>
779
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/>
791
/// 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"/>
796
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/>
798
public static
Tensor
<bool> GreaterThanOrEqual<T>(T x, in ReadOnlyTensorSpan<T> y)
803
/// 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"/>
809
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/>
901
/// 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"/>
906
/// <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
908
public static
Tensor
<bool> LessThan<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
911
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<bool> destination);
919
/// 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"/>
925
/// <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
936
/// Compares the elements of a <see cref="
Tensor
{T}"/> to see which elements are less than <paramref name="y"/>.
937
/// 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"/>
940
/// <param name="x"><see cref="
Tensor
{T}"/> to compare.</param>
942
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/>
944
public static
Tensor
<bool> LessThan<T>(in ReadOnlyTensorSpan<T> x, T y)
947
Tensor
<bool> destination = CreateFromShape<bool>(x.Lengths, false);
953
/// Compares the elements of a <see cref="
Tensor
{T}"/> to see which elements are less than <paramref name="y"/>.
954
/// 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"/>
957
/// <param name="x"><see cref="
Tensor
{T}"/> to compare.</param>
960
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/>
971
/// Compares the elements of a <see cref="
Tensor
{T}"/> to see which elements are less than <paramref name="y"/>.
972
/// 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"/>
975
/// <param name="x"><see cref="
Tensor
{T}"/> to compare.</param>
977
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/>
979
public static
Tensor
<bool> LessThan<T>(T x, in ReadOnlyTensorSpan<T> y)
983
/// Compares the elements of a <see cref="
Tensor
{T}"/> to see which elements are less than <paramref name="y"/>.
984
/// 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"/>
987
/// <param name="x"><see cref="
Tensor
{T}"/> to compare.</param>
990
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/>
1082
/// 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
/// <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
1089
public static
Tensor
<bool> LessThanOrEqual<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
1092
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<bool> destination);
1100
/// 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"/>
1106
/// <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
1117
/// Compares the elements of a <see cref="
Tensor
{T}"/> to see which elements are less than <paramref name="y"/>.
1118
/// 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"/>
1121
/// <param name="x"><see cref="
Tensor
{T}"/> to compare.</param>
1123
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/>
1125
public static
Tensor
<bool> LessThanOrEqual<T>(in ReadOnlyTensorSpan<T> x, T y)
1128
Tensor
<bool> destination = CreateFromShape<bool>(x.Lengths, false);
1134
/// Compares the elements of a <see cref="
Tensor
{T}"/> to see which elements are less than <paramref name="y"/>.
1135
/// 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"/>
1138
/// <param name="x"><see cref="
Tensor
{T}"/> to compare.</param>
1141
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/>
1152
/// Compares the elements of a <see cref="
Tensor
{T}"/> to see which elements are less than <paramref name="y"/>.
1153
/// 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"/>
1156
/// <param name="x"><see cref="
Tensor
{T}"/> to compare.</param>
1158
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/>
1160
public static
Tensor
<bool> LessThanOrEqual<T>(T x, in ReadOnlyTensorSpan<T> y)
1164
/// Compares the elements of a <see cref="
Tensor
{T}"/> to see which elements are less than <paramref name="y"/>.
1165
/// 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"/>
1168
/// <param name="x"><see cref="
Tensor
{T}"/> to compare.</param>
1171
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/>
1263
/// If <paramref name="tensor"/> is a 1D tensor, it will return <paramref name="tensor"/>. Otherwise it creates a new <see cref="
Tensor
{T}"/>
1266
/// <param name="tensor">Input <see cref="
Tensor
{T}"/></param>
1268
public static
Tensor
<T> PermuteDimensions<T>(this
Tensor
<T> tensor, ReadOnlySpan<int> dimensions)
1282
Tensor
<T> outTensor;
1320
/// <param name="tensor"><see cref="
Tensor
{T}"/> you want to reshape.</param>
1322
public static
Tensor
<T> Reshape<T>(this
Tensor
<T> tensor, ReadOnlySpan<nint> lengths)
1542
/// 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
1545
/// <param name="tensor">Input <see cref="
Tensor
{T}"/>.</param>
1547
public static
Tensor
<T> Resize<T>(
Tensor
<T> tensor, ReadOnlySpan<nint> lengths)
1551
Tensor
<T> output = Create(values, lengths, []);
1566
/// <param name="tensor">Input <see cref="
Tensor
{T}"/>.</param>
1568
public static void ResizeTo<T>(scoped in
Tensor
<T> tensor, in TensorSpan<T> destination)
1605
/// <param name="tensor">Input <see cref="
Tensor
{T}"/>.</param>
1606
public static
Tensor
<T> Reverse<T>(in ReadOnlyTensorSpan<T> tensor)
1608
Tensor
<T> output = CreateFromShape<T>(tensor.Lengths);
1618
/// <param name="tensor">Input <see cref="
Tensor
{T}"/>.</param>
1620
public static
Tensor
<T> ReverseDimension<T>(in ReadOnlyTensorSpan<T> tensor, int dimension)
1622
Tensor
<T> output = CreateFromShape<T>(tensor.Lengths);
1710
/// <param name="tensor">Input <see cref="
Tensor
{T}"/>.</param>
1713
public static
Tensor
<T> SetSlice<T>(this
Tensor
<T> tensor, in ReadOnlyTensorSpan<T> values, params ReadOnlySpan<NRange> ranges)
1722
/// <param name="tensor">Input <see cref="
Tensor
{T}"/>.</param>
1741
/// Split a <see cref="
Tensor
{T}"/> into <paramref name="splitCount"/> along the given <paramref name="dimension"/>. If the tensor cannot be split
1744
/// <param name="tensor">Input <see cref="
Tensor
{T}"/>.</param>
1747
public static
Tensor
<T>[] Split<T>(scoped in ReadOnlyTensorSpan<T> tensor, int splitCount, nint dimension)
1754
Tensor
<T>[] outputs = new
Tensor
<T>[splitCount];
1787
/// <param name="tensor">The <see cref="
Tensor
{T}"/> to remove all dimensions of length 1.</param>
1788
public static
Tensor
<T> Squeeze<T>(this
Tensor
<T> tensor)
1797
/// <param name="tensor">The <see cref="
Tensor
{T}"/> to remove dimension of length 1.</param>
1799
public static
Tensor
<T> SqueezeDimension<T>(this
Tensor
<T> tensor, int dimension)
1843
Tensor
<T> output = new Tensor<T>(tensor._values, tensor._start, lengths[..rank], strides[..rank]);
1988
/// Join multiple <see cref="
Tensor
{T}"/> along a new dimension that is added at position 0. All tensors must have the same shape.
1990
/// <param name="tensors">Input <see cref="
Tensor
{T}"/>.</param>
1991
public static
Tensor
<T> Stack<T>(params ReadOnlySpan<
Tensor
<T>> tensors)
1997
/// 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.
1999
/// <param name="tensors">Input <see cref="
Tensor
{T}"/>.</param>
2001
public static
Tensor
<T> StackAlongDimension<T>(int dimension, params ReadOnlySpan<
Tensor
<T>> tensors)
2017
Tensor
<T>[] outputs = new
Tensor
<T>[tensors.Length];
2026
/// Join multiple <see cref="
Tensor
{T}"/> along a new dimension that is added at position 0. All tensors must have the same shape.
2028
/// <param name="tensors">Input <see cref="
Tensor
{T}"/>.</param>
2030
public static ref readonly TensorSpan<T> Stack<T>(scoped in ReadOnlySpan<
Tensor
<T>> tensors, in TensorSpan<T> destination)
2036
/// 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.
2038
/// <param name="tensors">Input <see cref="
Tensor
{T}"/>.</param>
2041
public static ref readonly TensorSpan<T> StackAlongDimension<T>(scoped ReadOnlySpan<
Tensor
<T>> tensors, in TensorSpan<T> destination, int dimension)
2057
Tensor
<T>[] outputs = new
Tensor
<T>[tensors.Length];
2151
/// Creates a <see cref="string"/> representation of the <see cref="
Tensor
{T}"/>."/>
2156
public static string ToString<T>(this
Tensor
<T> tensor, ReadOnlySpan<nint> maximumLengths)
2165
/// <param name="tensor">Input <see cref="
Tensor
{T}"/>.</param>
2166
public static
Tensor
<T> Transpose<T>(
Tensor
<T> tensor)
2185
Tensor
<T> output = new Tensor<T>(tensor._values, tensor._start, lengths, strides);
2199
/// <param name="tensor">Input <see cref="
Tensor
{T}"/>.</param>
2201
public static bool TryBroadcastTo<T>(this
Tensor
<T> tensor, in TensorSpan<T> destination)
2238
/// <param name="tensor">The <see cref="
Tensor
{T}"/> to add a dimension of length 1.</param>
2240
public static
Tensor
<T> Unsqueeze<T>(this
Tensor
<T> tensor, int dimension)
2266
Tensor
<T> output = new Tensor<T>(tensor._values, tensor._start, newLengths, newStrides);
2350
/// Takes the absolute value of each element of the <see cref="
Tensor
{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
2353
public static
Tensor
<T> Abs<T>(in ReadOnlyTensorSpan<T> x)
2356
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
2377
/// Takes the inverse cosine of each element of the <see cref="
Tensor
{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
2380
public static
Tensor
<T> Acos<T>(in ReadOnlyTensorSpan<T> x)
2383
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
2389
/// Takes the inverse cosine of each element of the <see cref="
Tensor
{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
2404
/// 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.
2407
public static
Tensor
<T> Acosh<T>(in ReadOnlyTensorSpan<T> x)
2410
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
2431
/// 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.
2434
public static
Tensor
<T> AcosPi<T>(in ReadOnlyTensorSpan<T> x)
2437
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
2458
/// 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.
2462
public static
Tensor
<T> Add<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
2465
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<T> destination);
2471
/// Adds <paramref name="y"/> to each element of <paramref name="x"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
2475
public static
Tensor
<T> Add<T>(in ReadOnlyTensorSpan<T> x, T y)
2478
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
2514
/// Takes the inverse sin of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
2517
public static
Tensor
<T> Asin<T>(in ReadOnlyTensorSpan<T> x)
2520
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
2541
/// 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.
2544
public static
Tensor
<T> Asinh<T>(in ReadOnlyTensorSpan<T> x)
2547
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
2568
/// 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.
2571
public static
Tensor
<T> AsinPi<T>(in ReadOnlyTensorSpan<T> x)
2574
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
2595
/// Takes the arc tangent of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
2598
public static
Tensor
<T> Atan<T>(in ReadOnlyTensorSpan<T> x)
2601
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
2622
/// Takes the arc tangent of the two input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
2626
public static
Tensor
<T> Atan2<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
2629
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
2649
/// Takes the arc tangent of the two input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
2653
public static
Tensor
<T> Atan2<T>(in ReadOnlyTensorSpan<T> x, T y)
2656
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
2676
/// Takes the arc tangent of the two input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
2680
public static
Tensor
<T> Atan2<T>(T x, in ReadOnlyTensorSpan<T> y)
2683
Tensor
<T> destination = CreateFromShapeUninitialized<T>(y.Lengths);
2705
/// 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.
2709
public static
Tensor
<T> Atan2Pi<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
2712
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
2736
public static
Tensor
<T> Atan2Pi<T>(in ReadOnlyTensorSpan<T> x, T y)
2739
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
2763
public static
Tensor
<T> Atan2Pi<T>(T x, in ReadOnlyTensorSpan<T> y)
2766
Tensor
<T> destination = CreateFromShapeUninitialized<T>(y.Lengths);
2788
/// 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.
2791
public static
Tensor
<T> Atanh<T>(in ReadOnlyTensorSpan<T> x)
2794
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
2815
/// 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.
2818
public static
Tensor
<T> AtanPi<T>(in ReadOnlyTensorSpan<T> x)
2821
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
2859
/// 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.
2863
public static
Tensor
<T> BitwiseAnd<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
2866
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
2886
/// 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.
2890
public static
Tensor
<T> BitwiseAnd<T>(in ReadOnlyTensorSpan<T> x, T y)
2893
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
2915
/// 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.
2919
public static
Tensor
<T> BitwiseOr<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
2922
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
2942
/// 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.
2946
public static
Tensor
<T> BitwiseOr<T>(in ReadOnlyTensorSpan<T> x, T y)
2949
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
2971
/// Computes the element-wise cube root of the input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
2974
public static
Tensor
<T> Cbrt<T>(in ReadOnlyTensorSpan<T> x)
2977
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
2998
/// Computes the element-wise ceiling of the input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
3001
public static
Tensor
<T> Ceiling<T>(in ReadOnlyTensorSpan<T> x)
3004
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
3029
public static
Tensor
<TTo> ConvertChecked<TFrom, TTo>(in ReadOnlyTensorSpan<TFrom> source)
3033
Tensor
<TTo> destination = CreateFromShapeUninitialized<TTo>(source.Lengths);
3060
public static
Tensor
<TTo> ConvertSaturating<TFrom, TTo>(in ReadOnlyTensorSpan<TFrom> source)
3064
Tensor
<TTo> destination = CreateFromShapeUninitialized<TTo>(source.Lengths);
3091
public static
Tensor
<TTo> ConvertTruncating<TFrom, TTo>(in ReadOnlyTensorSpan<TFrom> source)
3095
Tensor
<TTo> destination = CreateFromShapeUninitialized<TTo>(source.Lengths);
3122
public static
Tensor
<T> CopySign<T>(in ReadOnlyTensorSpan<T> x, T sign)
3125
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
3131
/// 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.
3135
public static
Tensor
<T> CopySign<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> sign)
3138
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
3174
/// Takes the cosine of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
3177
public static
Tensor
<T> Cos<T>(in ReadOnlyTensorSpan<T> x)
3180
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
3201
/// Takes the hyperbolic cosine of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
3204
public static
Tensor
<T> Cosh<T>(in ReadOnlyTensorSpan<T> x)
3207
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
3243
/// <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>
3257
public static
Tensor
<T> CosPi<T>(in ReadOnlyTensorSpan<T> x)
3260
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
3294
public static
Tensor
<T> DegreesToRadians<T>(in ReadOnlyTensorSpan<T> x)
3297
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
3334
/// Divides each element of <paramref name="x"/> by <paramref name="y"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
3338
public static
Tensor
<T> Divide<T>(in ReadOnlyTensorSpan<T> x, T y)
3341
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
3347
/// Divides <paramref name="x"/> by each element of <paramref name="y"/> and returns a new <see cref="
Tensor
{T}"/> with the result."/>
3351
public static
Tensor
<T> Divide<T>(T x, in ReadOnlyTensorSpan<T> y)
3354
Tensor
<T> destination = CreateFromShapeUninitialized<T>(y.Lengths);
3365
public static
Tensor
<T> Divide<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
3368
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<T> destination);
3438
public static
Tensor
<T> Exp<T>(in ReadOnlyTensorSpan<T> x)
3441
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
3465
public static
Tensor
<T> Exp10<T>(in ReadOnlyTensorSpan<T> x)
3468
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
3490
public static
Tensor
<T> Exp10M1<T>(in ReadOnlyTensorSpan<T> x)
3493
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
3513
public static
Tensor
<T> Exp2<T>(in ReadOnlyTensorSpan<T> x)
3516
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
3536
public static
Tensor
<T> Exp2M1<T>(in ReadOnlyTensorSpan<T> x)
3539
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
3559
public static
Tensor
<T> ExpM1<T>(in ReadOnlyTensorSpan<T> x)
3562
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
3582
public static
Tensor
<T> Floor<T>(in ReadOnlyTensorSpan<T> x)
3585
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
3609
public static
Tensor
<T> Hypot<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
3612
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<T> destination);
3638
public static
Tensor
<T> Ieee754Remainder<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
3641
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<T> destination);
3662
public static
Tensor
<T> Ieee754Remainder<T>(in ReadOnlyTensorSpan<T> x, T y)
3665
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
3685
public static
Tensor
<T> Ieee754Remainder<T>(T x, in ReadOnlyTensorSpan<T> y)
3688
Tensor
<T> destination = CreateFromShapeUninitialized<T>(y.Lengths);
3709
public static
Tensor
<int> ILogB<T>(in ReadOnlyTensorSpan<T> x)
3712
Tensor
<int> destination = CreateFromShapeUninitialized<int>(x.Lengths);
3781
public static
Tensor
<T> LeadingZeroCount<T>(in ReadOnlyTensorSpan<T> x)
3784
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
3805
/// Takes the natural logarithm of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
3808
public static
Tensor
<T> Log<T>(in ReadOnlyTensorSpan<T> x)
3811
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
3832
public static
Tensor
<T> Log<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
3835
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<T> destination);
3855
public static
Tensor
<T> Log<T>(in ReadOnlyTensorSpan<T> x, T y)
3858
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
3878
/// 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.
3881
public static
Tensor
<T> Log10<T>(in ReadOnlyTensorSpan<T> x)
3884
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
3905
/// 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.
3908
public static
Tensor
<T> Log10P1<T>(in ReadOnlyTensorSpan<T> x)
3911
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
3932
/// 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.
3935
public static
Tensor
<T> Log2<T>(in ReadOnlyTensorSpan<T> x)
3938
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
3959
/// 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.
3962
public static
Tensor
<T> Log2P1<T>(in ReadOnlyTensorSpan<T> x)
3965
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
3986
/// 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.
3989
public static
Tensor
<T> LogP1<T>(in ReadOnlyTensorSpan<T> x)
3992
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
4030
public static
Tensor
<T> Max<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
4033
TensorOperation.ValidateCompatibility(in x, in y, out
Tensor
<T> output);
4053
public static
Tensor
<T> Max<T>(in ReadOnlyTensorSpan<T> x, T y)
4056
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
4093
public static
Tensor
<T> MaxMagnitude<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
4096
TensorOperation.ValidateCompatibility(in x, in y, out
Tensor
<T> destination);
4116
public static
Tensor
<T> MaxMagnitude<T>(in ReadOnlyTensorSpan<T> x, T y)
4119
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
4156
public static
Tensor
<T> MaxMagnitudeNumber<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
4159
TensorOperation.ValidateCompatibility(in x, in y, out
Tensor
<T> destination);
4179
public static
Tensor
<T> MaxMagnitudeNumber<T>(in ReadOnlyTensorSpan<T> x, T y)
4182
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
4219
public static
Tensor
<T> MaxNumber<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
4222
TensorOperation.ValidateCompatibility(in x, in y, out
Tensor
<T> destination);
4242
public static
Tensor
<T> MaxNumber<T>(in ReadOnlyTensorSpan<T> x, T y)
4245
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
4282
public static
Tensor
<T> Min<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
4285
TensorOperation.ValidateCompatibility(in x, in y, out
Tensor
<T> output);
4305
public static
Tensor
<T> Min<T>(in ReadOnlyTensorSpan<T> x, T y)
4308
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
4345
public static
Tensor
<T> MinMagnitude<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
4348
TensorOperation.ValidateCompatibility(in x, in y, out
Tensor
<T> destination);
4368
public static
Tensor
<T> MinMagnitude<T>(in ReadOnlyTensorSpan<T> x, T y)
4371
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
4408
public static
Tensor
<T> MinMagnitudeNumber<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
4411
TensorOperation.ValidateCompatibility(in x, in y, out
Tensor
<T> destination);
4431
public static
Tensor
<T> MinMagnitudeNumber<T>(in ReadOnlyTensorSpan<T> x, T y)
4434
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
4471
public static
Tensor
<T> MinNumber<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
4474
TensorOperation.ValidateCompatibility(in x, in y, out
Tensor
<T> destination);
4494
public static
Tensor
<T> MinNumber<T>(in ReadOnlyTensorSpan<T> x, T y)
4497
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
4517
/// Multiplies each element of <paramref name="x"/> with <paramref name="y"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
4521
public static
Tensor
<T> Multiply<T>(in ReadOnlyTensorSpan<T> x, T y)
4524
Tensor
<T> destination = CreateFromShape<T>(x.Lengths);
4530
/// Multiplies each element of <paramref name="x"/> with <paramref name="y"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
4535
public static
Tensor
<T> Multiply<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
4538
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<T> destination);
4576
public static
Tensor
<T> Negate<T>(in ReadOnlyTensorSpan<T> x)
4579
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
4613
public static
Tensor
<T> OnesComplement<T>(in ReadOnlyTensorSpan<T> x)
4616
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
4636
public static
Tensor
<T> PopCount<T>(in ReadOnlyTensorSpan<T> x)
4639
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
4660
public static
Tensor
<T> Pow<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
4663
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<T> destination);
4683
public static
Tensor
<T> Pow<T>(in ReadOnlyTensorSpan<T> x, T y)
4686
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
4706
public static
Tensor
<T> Pow<T>(T x, in ReadOnlyTensorSpan<T> y)
4709
Tensor
<T> destination = CreateFromShapeUninitialized<T>(y.Lengths);
4742
public static
Tensor
<T> RadiansToDegrees<T>(in ReadOnlyTensorSpan<T> x)
4745
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
4765
public static
Tensor
<T> Reciprocal<T>(in ReadOnlyTensorSpan<T> x)
4768
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
4789
public static
Tensor
<T> RootN<T>(in ReadOnlyTensorSpan<T> x, int n)
4792
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
4815
public static
Tensor
<T> RotateLeft<T>(in ReadOnlyTensorSpan<T> x, int rotateAmount)
4818
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
4842
public static
Tensor
<T> RotateRight<T>(in ReadOnlyTensorSpan<T> x, int rotateAmount)
4845
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
4867
public static
Tensor
<T> Round<T>(in ReadOnlyTensorSpan<T> x)
4870
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
4890
public static
Tensor
<T> Round<T>(in ReadOnlyTensorSpan<T> x, int digits, MidpointRounding mode)
4893
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
4914
public static
Tensor
<T> Round<T>(in ReadOnlyTensorSpan<T> x, int digits)
4917
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
4937
public static
Tensor
<T> Round<T>(in ReadOnlyTensorSpan<T> x, MidpointRounding mode)
4940
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
4961
public static
Tensor
<T> Sigmoid<T>(in ReadOnlyTensorSpan<T> x)
4964
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
4983
/// Takes the sin of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
4986
public static
Tensor
<T> Sin<T>(in ReadOnlyTensorSpan<T> x)
4989
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
5011
public static
Tensor
<T> Sinh<T>(in ReadOnlyTensorSpan<T> x)
5014
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
5034
public static
Tensor
<T> SinPi<T>(in ReadOnlyTensorSpan<T> x)
5037
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
5057
public static
Tensor
<T> SoftMax<T>(in ReadOnlyTensorSpan<T> x)
5063
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
5085
/// Takes the square root of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
5088
public static
Tensor
<T> Sqrt<T>(in ReadOnlyTensorSpan<T> x)
5091
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
5130
/// Subtracts <paramref name="y"/> from each element of <paramref name="x"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
5134
public static
Tensor
<T> Subtract<T>(in ReadOnlyTensorSpan<T> x, T y)
5137
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
5143
/// Subtracts each element of <paramref name="y"/> from <paramref name="x"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
5147
public static
Tensor
<T> Subtract<T>(T x, in ReadOnlyTensorSpan<T> y)
5150
Tensor
<T> destination = CreateFromShapeUninitialized<T>(y.Lengths);
5156
/// Subtracts each element of <paramref name="x"/> from <paramref name="y"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
5160
public static
Tensor
<T> Subtract<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
5163
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<T> destination);
5244
public static
Tensor
<T> Tan<T>(in ReadOnlyTensorSpan<T> x)
5247
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
5267
public static
Tensor
<T> Tanh<T>(in ReadOnlyTensorSpan<T> x)
5270
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
5290
public static
Tensor
<T> TanPi<T>(in ReadOnlyTensorSpan<T> x)
5293
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
5313
public static
Tensor
<T> TrailingZeroCount<T>(in ReadOnlyTensorSpan<T> x)
5316
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
5336
public static
Tensor
<T> Truncate<T>(in ReadOnlyTensorSpan<T> x)
5339
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
5360
public static
Tensor
<T> Xor<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
5363
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<T> destination);
5381
/// Computes the element-wise Xor of the two input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
5385
public static
Tensor
<T> Xor<T>(in ReadOnlyTensorSpan<T> x, T y)
5388
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
System\Numerics\Tensors\netcore\Tensor_1.cs (28)
18
public sealed class Tensor<T> : ITensor<
Tensor
<T>, T>, IEnumerable<T>
21
public static
Tensor
<T> Empty { get; } = new();
93
public
Tensor
<T> this[params ReadOnlySpan<NRange> ranges]
126
public static implicit operator
Tensor
<T>(T[] array) => Tensor.Create(array);
131
public static implicit operator TensorSpan<T>(
Tensor
<T> tensor) => tensor.AsTensorSpan();
134
public static implicit operator ReadOnlyTensorSpan<T>(
Tensor
<T> tensor) => tensor.AsReadOnlyTensorSpan();
215
public
Tensor
<T> Slice(params ReadOnlySpan<nint> startIndexes)
230
public
Tensor
<T> Slice(params ReadOnlySpan<NIndex> startIndexes)
245
public
Tensor
<T> Slice(params ReadOnlySpan<NRange> ranges)
260
public
Tensor
<T> ToDenseTensor()
262
Tensor
<T> result = this;
295
/// <returns>A <see cref="string"/> representation of the <see cref="
Tensor
{T}"/></returns>
331
ref readonly T IReadOnlyTensor<
Tensor
<T>, T>.this[params ReadOnlySpan<nint> indexes] => ref this[indexes];
333
ref readonly T IReadOnlyTensor<
Tensor
<T>, T>.this[params ReadOnlySpan<NIndex> indexes] => ref this[indexes];
335
ReadOnlyTensorDimensionSpan<T> IReadOnlyTensor<
Tensor
<T>, T>.GetDimensionSpan(int dimension) => AsReadOnlyTensorSpan().GetDimensionSpan(dimension);
337
ref readonly T IReadOnlyTensor<
Tensor
<T>, T>.GetPinnableReference() => ref GetPinnableReference();
339
ReadOnlySpan<T> IReadOnlyTensor<
Tensor
<T>, T>.GetSpan(scoped ReadOnlySpan<nint> startIndexes, int length) => AsReadOnlyTensorSpan().GetSpan(startIndexes, length);
341
ReadOnlySpan<T> IReadOnlyTensor<
Tensor
<T>, T>.GetSpan(scoped ReadOnlySpan<NIndex> startIndexes, int length) => AsReadOnlyTensorSpan().GetSpan(startIndexes, length);
375
static
Tensor
<T> ITensor<
Tensor
<T>, T>.CreateFromShape(scoped ReadOnlySpan<nint> lengths, bool pinned) => Tensor.CreateFromShape<T>(lengths, pinned);
377
static
Tensor
<T> ITensor<
Tensor
<T>, T>.CreateFromShape(scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides, bool pinned) => Tensor.CreateFromShape<T>(lengths, strides, pinned);
379
static
Tensor
<T> ITensor<
Tensor
<T>, T>.CreateFromShapeUninitialized(scoped ReadOnlySpan<nint> lengths, bool pinned) => Tensor.CreateFromShapeUninitialized<T>(lengths, pinned);
381
static
Tensor
<T> ITensor<
Tensor
<T>, T>.CreateFromShapeUninitialized(scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides, bool pinned) => Tensor.CreateFromShapeUninitialized<T>(lengths, strides, pinned);
386
private readonly
Tensor
<T> _tensor;
391
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)
System\Runtime\InteropServices\TensorMarshal.cs (1)
9
/// <summary>Provides methods to interoperate with <see cref="
Tensor
{T}" />, <see cref="TensorSpan{T}" />, and <see cref="ReadOnlyTensorSpan{T}" />.</summary>