16 instantiations of TensorSpan
System.Numerics.Tensors (16)
System\Numerics\Tensors\netcore\Tensor.cs (11)
37
/// <inheritdoc cref="TensorSpan{T}.
TensorSpan
(T[])" />
39
=> new
TensorSpan
<T>(array);
41
/// <inheritdoc cref="TensorSpan{T}.
TensorSpan
(T[], ReadOnlySpan{nint})" />
43
=> new
TensorSpan
<T>(array, lengths);
45
/// <inheritdoc cref="TensorSpan{T}.
TensorSpan
(T[], ReadOnlySpan{nint} , ReadOnlySpan{nint})" />
47
=> new
TensorSpan
<T>(array, lengths, strides);
49
/// <inheritdoc cref="TensorSpan{T}.
TensorSpan
(T[], int, ReadOnlySpan{nint}, ReadOnlySpan{nint})" />
50
public static TensorSpan<T> AsTensorSpan<T>(this T[]? array, int start, scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides) => new
TensorSpan
<T>(array, start, lengths, strides);
1576
TensorSpan<T> output = new
TensorSpan
<T>(ref tensor._reference, tensor._shape.LinearLength, newLengths, strides);
2055
TensorSpan<T> output = new
TensorSpan
<T>(ref tensor._reference, tensor._shape.LinearLength, lengths[..newRank], strides[..newRank], strideOrder[..newRank]);
2496
TensorSpan<T> output = new
TensorSpan
<T>(ref tensor._reference, tensor._shape.LinearLength, newLengths, newStrides);
System\Numerics\Tensors\netcore\Tensor_1.cs (1)
194
public TensorSpan<T> AsTensorSpan() => new
TensorSpan
<T>(ref Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(_values), _start), in _shape);
System\Numerics\Tensors\netcore\TensorSpan.cs (4)
235
public static implicit operator TensorSpan<T>(T[]? array) => new
TensorSpan
<T>(array);
308
return new
TensorSpan
<T>(
318
return new
TensorSpan
<T>(
328
return new
TensorSpan
<T>(
442 references to TensorSpan
System.Numerics.Tensors (442)
System\Numerics\Tensors\netcore\IReadOnlyTensor_1.cs (2)
57
void CopyTo(scoped in
TensorSpan
<T> destination);
100
bool TryCopyTo(scoped in
TensorSpan
<T> destination);
System\Numerics\Tensors\netcore\ITensor_1.cs (4)
72
TensorSpan
<T> AsTensorSpan();
77
TensorSpan
<T> AsTensorSpan(params scoped ReadOnlySpan<nint> startIndexes);
80
TensorSpan
<T> AsTensorSpan(params scoped ReadOnlySpan<NIndex> startIndexes);
85
TensorSpan
<T> AsTensorSpan(params scoped ReadOnlySpan<NRange> ranges);
System\Numerics\Tensors\netcore\ReadOnlyTensorSpan_1.cs (4)
357
/// <inheritdoc cref="IReadOnlyTensor{TSelf, T}.CopyTo(in
TensorSpan
{T})" />
358
public void CopyTo(scoped in
TensorSpan
<T> destination)
441
/// <inheritdoc cref="IReadOnlyTensor{TSelf, T}.TryCopyTo(in
TensorSpan
{T})" />
442
public bool TryCopyTo(scoped in
TensorSpan
<T> destination)
System\Numerics\Tensors\netcore\Tensor.cs (387)
37
/// <inheritdoc cref="
TensorSpan
{T}.TensorSpan(T[])" />
38
public static
TensorSpan
<T> AsTensorSpan<T>(this T[]? array)
41
/// <inheritdoc cref="
TensorSpan
{T}.TensorSpan(T[], ReadOnlySpan{nint})" />
42
public static
TensorSpan
<T> AsTensorSpan<T>(this T[]? array, scoped ReadOnlySpan<nint> lengths)
45
/// <inheritdoc cref="
TensorSpan
{T}.TensorSpan(T[], ReadOnlySpan{nint} , ReadOnlySpan{nint})" />
46
public static
TensorSpan
<T> AsTensorSpan<T>(this T[]? array, scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides)
49
/// <inheritdoc cref="
TensorSpan
{T}.TensorSpan(T[], int, ReadOnlySpan{nint}, ReadOnlySpan{nint})" />
50
public static
TensorSpan
<T> AsTensorSpan<T>(this T[]? array, int start, scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides) => new TensorSpan<T>(array, start, lengths, strides);
84
/// <param name="source">Input <see cref="
TensorSpan
{T}"/>.</param>
86
public static void BroadcastTo<T>(this Tensor<T> source, in
TensorSpan
<T> destination)
95
/// <param name="source">Input <see cref="
TensorSpan
{T}"/>.</param>
96
/// <param name="destination">Other <see cref="
TensorSpan
{T}"/> to make shapes broadcastable.</param>
97
public static void BroadcastTo<T>(in this
TensorSpan
<T> source, in
TensorSpan
<T> destination)
106
/// <param name="source">Input <see cref="
TensorSpan
{T}"/>.</param>
108
public static void BroadcastTo<T>(in this ReadOnlyTensorSpan<T> source, in
TensorSpan
<T> destination)
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)
453
/// Fills the given <see cref="
TensorSpan
{T}"/> with random data in a Gaussian normal distribution. <see cref="System.Random"/>
457
/// <param name="destination">The destination <see cref="
TensorSpan
{T}"/> where the data will be stored.</param>
460
public static ref readonly
TensorSpan
<T> FillGaussianNormalDistribution<T>(in
TensorSpan
<T> destination, Random? random = null) where T : IFloatingPoint<T>
476
/// Fills the given <see cref="
TensorSpan
{T}"/> with random data in a uniform distribution. <see cref="System.Random"/>
480
/// <param name="destination">The destination <see cref="
TensorSpan
{T}"/> where the data will be stored.</param>
483
public static ref readonly
TensorSpan
<T> FillUniformDistribution<T>(in
TensorSpan
<T> destination, Random? random = null) where T : IFloatingPoint<T>
497
/// before they are compared. It returns a <see cref="
TensorSpan
{Boolean}"/> where the value is true if the elements are equal and false if they are not."/>
501
/// <returns>A <see cref="
TensorSpan
{Boolean}"/> where the value is true if the elements are equal and false if they are not.</returns>
512
/// before they are compared. It returns a <see cref="
TensorSpan
{Boolean}"/> where the value is true if the elements are equal and false if they are not."/>
517
/// <returns>A <see cref="
TensorSpan
{Boolean}"/> where the value is true if the elements are equal and false if they are not.</returns>
518
public static ref readonly
TensorSpan
<bool> Equals<T>(scoped in ReadOnlyTensorSpan<T> x, scoped in ReadOnlyTensorSpan<T> y, in
TensorSpan
<bool> destination)
528
/// before they are compared. It returns a <see cref="
TensorSpan
{Boolean}"/> where the value is true if the elements are equal and false if they are not."/>
532
/// <returns>A <see cref="
TensorSpan
{Boolean}"/> where the value is true if the elements are equal and false if they are not.</returns>
543
/// before they are compared. It returns a <see cref="
TensorSpan
{Boolean}"/> where the value is true if the elements are equal and false if they are not."/>
548
/// <returns>A <see cref="
TensorSpan
{Boolean}"/> where the value is true if the elements are equal and false if they are not.</returns>
549
public static ref readonly
TensorSpan
<bool> Equals<T>(scoped in ReadOnlyTensorSpan<T> x, T y, in
TensorSpan
<bool> destination)
625
public static ref readonly
TensorSpan
<T> FilteredUpdate<T>(in this
TensorSpan
<T> tensor, scoped in ReadOnlyTensorSpan<bool> filter, T value)
639
public static ref readonly
TensorSpan
<T> FilteredUpdate<T>(in this
TensorSpan
<T> tensor, scoped in ReadOnlyTensorSpan<bool> filter, scoped in ReadOnlyTensorSpan<T> values)
677
public static ref readonly
TensorSpan
<bool> GreaterThan<T>(scoped in ReadOnlyTensorSpan<T> x, scoped in ReadOnlyTensorSpan<T> y, in
TensorSpan
<bool> destination)
712
public static ref readonly
TensorSpan
<bool> GreaterThan<T>(scoped in ReadOnlyTensorSpan<T> x, T y, in
TensorSpan
<bool> destination)
742
public static ref readonly
TensorSpan
<bool> GreaterThan<T>(T x, scoped in ReadOnlyTensorSpan<T> y, in
TensorSpan
<bool> destination)
858
public static ref readonly
TensorSpan
<bool> GreaterThanOrEqual<T>(scoped in ReadOnlyTensorSpan<T> x, scoped in ReadOnlyTensorSpan<T> y, in
TensorSpan
<bool> destination)
893
public static ref readonly
TensorSpan
<bool> GreaterThanOrEqual<T>(scoped in ReadOnlyTensorSpan<T> x, T y, in
TensorSpan
<bool> destination)
923
public static ref readonly
TensorSpan
<bool> GreaterThanOrEqual<T>(T x, scoped in ReadOnlyTensorSpan<T> y, in
TensorSpan
<bool> destination)
1039
public static ref readonly
TensorSpan
<bool> LessThan<T>(scoped in ReadOnlyTensorSpan<T> x, scoped in ReadOnlyTensorSpan<T> y, in
TensorSpan
<bool> destination)
1074
public static ref readonly
TensorSpan
<bool> LessThan<T>(scoped in ReadOnlyTensorSpan<T> x, T y, in
TensorSpan
<bool> destination)
1104
public static ref readonly
TensorSpan
<bool> LessThan<T>(T x, scoped in ReadOnlyTensorSpan<T> y, in
TensorSpan
<bool> destination)
1220
public static ref readonly
TensorSpan
<bool> LessThanOrEqual<T>(scoped in ReadOnlyTensorSpan<T> x, scoped in ReadOnlyTensorSpan<T> y, in
TensorSpan
<bool> destination)
1255
public static ref readonly
TensorSpan
<bool> LessThanOrEqual<T>(scoped in ReadOnlyTensorSpan<T> x, T y, in
TensorSpan
<bool> destination)
1285
public static ref readonly
TensorSpan
<bool> LessThanOrEqual<T>(T x, scoped in ReadOnlyTensorSpan<T> y, in
TensorSpan
<bool> destination)
1509
/// <param name="tensor"><see cref="
TensorSpan
{T}"/> you want to reshape.</param>
1511
public static
TensorSpan
<T> Reshape<T>(in this
TensorSpan
<T> tensor, scoped ReadOnlySpan<nint> lengths)
1576
TensorSpan
<T> output = new TensorSpan<T>(ref tensor._reference, tensor._shape.LinearLength, newLengths, strides);
1585
/// <param name="tensor"><see cref="
TensorSpan
{T}"/> you want to reshape.</param>
1683
/// <param name="destination">Destination <see cref="
TensorSpan
{T}"/> with the desired new shape.</param>
1684
public static void ResizeTo<T>(scoped in Tensor<T> tensor, in
TensorSpan
<T> destination)
1693
/// <param name="tensor">Input <see cref="
TensorSpan
{T}"/>.</param>
1694
/// <param name="destination">Destination <see cref="
TensorSpan
{T}"/> with the desired new shape.</param>
1695
public static void ResizeTo<T>(scoped in
TensorSpan
<T> tensor, in
TensorSpan
<T> destination)
1705
/// <param name="destination">Destination <see cref="
TensorSpan
{T}"/> with the desired new shape.</param>
1706
public static void ResizeTo<T>(scoped in ReadOnlyTensorSpan<T> tensor, in
TensorSpan
<T> destination)
1747
/// <param name="tensor">Input <see cref="
TensorSpan
{T}"/>.</param>
1749
public static ref readonly
TensorSpan
<T> Reverse<T>(scoped in ReadOnlyTensorSpan<T> tensor, in
TensorSpan
<T> destination)
1758
/// <param name="tensor">Input <see cref="
TensorSpan
{T}"/>.</param>
1761
public static ref readonly
TensorSpan
<T> ReverseDimension<T>(scoped in ReadOnlyTensorSpan<T> tensor, in
TensorSpan
<T> destination, int dimension)
1800
public static bool SequenceEqual<T>(this scoped in
TensorSpan
<T> tensor, scoped in ReadOnlyTensorSpan<T> other)
1841
public static ref readonly
TensorSpan
<T> SetSlice<T>(this in
TensorSpan
<T> tensor, scoped in ReadOnlyTensorSpan<T> values, params scoped ReadOnlySpan<NRange> ranges)
1985
/// <param name="tensor">The <see cref="
TensorSpan
{T}"/> to remove all dimensions of length 1.</param>
1986
public static
TensorSpan
<T> Squeeze<T>(in this
TensorSpan
<T> tensor)
1995
/// <param name="tensor">The <see cref="
TensorSpan
{T}"/> to remove dimension of length 1.</param>
1997
public static
TensorSpan
<T> SqueezeDimension<T>(in this
TensorSpan
<T> tensor, int dimension)
2055
TensorSpan
<T> output = new TensorSpan<T>(ref tensor._reference, tensor._shape.LinearLength, lengths[..newRank], strides[..newRank], strideOrder[..newRank]);
2216
public static ref readonly
TensorSpan
<T> Stack<T>(scoped in ReadOnlySpan<Tensor<T>> tensors, in
TensorSpan
<T> destination)
2227
public static ref readonly
TensorSpan
<T> StackAlongDimension<T>(scoped ReadOnlySpan<Tensor<T>> tensors, in
TensorSpan
<T> destination, int dimension)
2254
/// Creates a <see cref="string"/> representation of the <see cref="
TensorSpan
{T}"/>."/>
2256
/// <param name="tensor">The <see cref="
TensorSpan
{T}"/> you want to represent as a string.</param>
2259
public static string ToString<T>(this in
TensorSpan
<T> tensor, ReadOnlySpan<nint> maximumLengths)
2393
/// <param name="destination">Destination <see cref="
TensorSpan
{T}"/>.</param>
2394
public static bool TryBroadcastTo<T>(this Tensor<T> tensor, in
TensorSpan
<T> destination)
2403
/// <param name="tensor">Input <see cref="
TensorSpan
{T}"/>.</param>
2404
/// <param name="destination">Destination <see cref="
TensorSpan
{T}"/>.</param>
2405
public static bool TryBroadcastTo<T>(in this
TensorSpan
<T> tensor, in
TensorSpan
<T> destination)
2415
/// <param name="destination">Destination <see cref="
TensorSpan
{T}"/>.</param>
2416
public static bool TryBroadcastTo<T>(in this ReadOnlyTensorSpan<T> tensor, in
TensorSpan
<T> destination)
2468
/// <param name="tensor">The <see cref="
TensorSpan
{T}"/> to add a dimension of length 1.</param>
2470
public static
TensorSpan
<T> Unsqueeze<T>(in this
TensorSpan
<T> tensor, int dimension)
2496
TensorSpan
<T> output = new TensorSpan<T>(ref tensor._reference, tensor._shape.LinearLength, newLengths, newStrides);
2555
/// Takes the absolute value of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
TensorSpan
{T}"/> with the result.
2557
/// <param name="x">The <see cref="
TensorSpan
{T}"/> to take the abs of.</param>
2558
/// <param name="destination">The <see cref="
TensorSpan
{T}"/> destination.</param>
2559
public static ref readonly
TensorSpan
<T> Abs<T>(scoped in ReadOnlyTensorSpan<T> x, in
TensorSpan
<T> destination)
2584
/// <param name="x">The <see cref="
TensorSpan
{T}"/> to take the sin of.</param>
2586
public static ref readonly
TensorSpan
<T> Acos<T>(scoped in ReadOnlyTensorSpan<T> x, in
TensorSpan
<T> destination)
2609
/// Takes the inverse hyperbolic cosine of each element of the <see cref="
TensorSpan
{T}"/> and returns a new <see cref="
TensorSpan
{T}"/> with the result.
2611
/// <param name="x">The <see cref="
TensorSpan
{T}"/> to take the sin of.</param>
2613
public static ref readonly
TensorSpan
<T> Acosh<T>(scoped in ReadOnlyTensorSpan<T> x, in
TensorSpan
<T> destination)
2636
/// Takes the inverse hyperbolic cosine divided by pi of each element of the <see cref="
TensorSpan
{T}"/> and returns a new <see cref="
TensorSpan
{T}"/> with the result.
2640
public static ref readonly
TensorSpan
<T> AcosPi<T>(scoped in ReadOnlyTensorSpan<T> x, in
TensorSpan
<T> destination)
2682
public static ref readonly
TensorSpan
<T> Add<T>(scoped in ReadOnlyTensorSpan<T> x, scoped in ReadOnlyTensorSpan<T> y, in
TensorSpan
<T> destination)
2691
/// Adds <paramref name="y"/> to each element of <paramref name="x"/> and returns a new <see cref="
TensorSpan
{T}"/> with the result.
2696
public static ref readonly
TensorSpan
<T> Add<T>(scoped in ReadOnlyTensorSpan<T> x, T y, in
TensorSpan
<T> destination)
2719
/// Takes the inverse sin of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
TensorSpan
{T}"/> with the result.
2723
public static ref readonly
TensorSpan
<T> Asin<T>(scoped in ReadOnlyTensorSpan<T> x, in
TensorSpan
<T> destination)
2746
/// Takes the inverse hyperbolic sine of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
TensorSpan
{T}"/> with the result.
2750
public static ref readonly
TensorSpan
<T> Asinh<T>(scoped in ReadOnlyTensorSpan<T> x, in
TensorSpan
<T> destination)
2773
/// Takes the inverse hyperbolic sine divided by pi of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
TensorSpan
{T}"/> with the result.
2777
public static ref readonly
TensorSpan
<T> AsinPi<T>(scoped in ReadOnlyTensorSpan<T> x, in
TensorSpan
<T> destination)
2800
/// Takes the arc tangent of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
TensorSpan
{T}"/> with the result.
2804
public static ref readonly
TensorSpan
<T> Atan<T>(scoped in ReadOnlyTensorSpan<T> x, in
TensorSpan
<T> destination)
2828
/// Takes the arc tangent of the two input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
TensorSpan
{T}"/> with the result.
2833
public static ref readonly
TensorSpan
<T> Atan2<T>(scoped in ReadOnlyTensorSpan<T> x, scoped in ReadOnlyTensorSpan<T> y, in
TensorSpan
<T> destination)
2855
/// Takes the arc tangent of the two input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
TensorSpan
{T}"/> with the result.
2860
public static ref readonly
TensorSpan
<T> Atan2<T>(scoped in ReadOnlyTensorSpan<T> x, T y, in
TensorSpan
<T> destination)
2882
/// Takes the arc tangent of the two input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
TensorSpan
{T}"/> with the result.
2887
public static ref readonly
TensorSpan
<T> Atan2<T>(T x, scoped in ReadOnlyTensorSpan<T> y, in
TensorSpan
<T> destination)
2911
/// Takes the arc tangent of the two input <see cref="ReadOnlyTensorSpan{T}"/>, divides each element by pi, and returns a new <see cref="
TensorSpan
{T}"/> with the result.
2916
public static ref readonly
TensorSpan
<T> Atan2Pi<T>(scoped in ReadOnlyTensorSpan<T> x, scoped in ReadOnlyTensorSpan<T> y, in
TensorSpan
<T> destination)
2925
/// Takes the arc tangent of the two input <see cref="ReadOnlyTensorSpan{T}"/>, divides each element by pi, and returns a new <see cref="
TensorSpan
{T}"/> with the result.
2938
/// Takes the arc tangent of the two input <see cref="ReadOnlyTensorSpan{T}"/>, divides each element by pi, and returns a new <see cref="
TensorSpan
{T}"/> with the result.
2943
public static ref readonly
TensorSpan
<T> Atan2Pi<T>(scoped in ReadOnlyTensorSpan<T> x, T y, in
TensorSpan
<T> destination)
2952
/// Takes the arc tangent of the two input <see cref="ReadOnlyTensorSpan{T}"/>, divides each element by pi, and returns a new <see cref="
TensorSpan
{T}"/> with the result.
2965
/// Takes the arc tangent of the two input <see cref="ReadOnlyTensorSpan{T}"/>, divides each element by pi, and returns a new <see cref="
TensorSpan
{T}"/> with the result.
2970
public static ref readonly
TensorSpan
<T> Atan2Pi<T>(T x, scoped in ReadOnlyTensorSpan<T> y, in
TensorSpan
<T> destination)
2993
/// Takes the inverse hyperbolic tangent of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
TensorSpan
{T}"/> with the result.
2997
public static ref readonly
TensorSpan
<T> Atanh<T>(scoped in ReadOnlyTensorSpan<T> x, in
TensorSpan
<T> destination)
3020
/// Takes the inverse hyperbolic tangent divided by pi of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
TensorSpan
{T}"/> with the result.
3024
public static ref readonly
TensorSpan
<T> AtanPi<T>(scoped in ReadOnlyTensorSpan<T> x, in
TensorSpan
<T> destination)
3037
/// <param name="x">The <see cref="
TensorSpan
{T}"/> to take the mean of.</param>
3065
/// Computes the element-wise bitwise and of the two input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
TensorSpan
{T}"/> with the result.
3070
public static ref readonly
TensorSpan
<T> BitwiseAnd<T>(scoped in ReadOnlyTensorSpan<T> x, scoped in ReadOnlyTensorSpan<T> y, in
TensorSpan
<T> destination)
3092
/// Computes the element-wise bitwise and of the two input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
TensorSpan
{T}"/> with the result.
3097
public static ref readonly
TensorSpan
<T> BitwiseAnd<T>(scoped in ReadOnlyTensorSpan<T> x, T y, in
TensorSpan
<T> destination)
3121
/// Computes the element-wise bitwise of of the two input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
TensorSpan
{T}"/> with the result.
3126
public static ref readonly
TensorSpan
<T> BitwiseOr<T>(scoped in ReadOnlyTensorSpan<T> x, scoped in ReadOnlyTensorSpan<T> y, in
TensorSpan
<T> destination)
3148
/// Computes the element-wise bitwise or of the two input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
TensorSpan
{T}"/> with the result.
3153
public static ref readonly
TensorSpan
<T> BitwiseOr<T>(scoped in ReadOnlyTensorSpan<T> x, T y, in
TensorSpan
<T> destination)
3176
/// Computes the element-wise cube root of the input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
TensorSpan
{T}"/> with the result.
3180
public static ref readonly
TensorSpan
<T> Cbrt<T>(scoped in ReadOnlyTensorSpan<T> x, in
TensorSpan
<T> destination)
3203
/// Computes the element-wise ceiling of the input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
TensorSpan
{T}"/> with the result.
3207
public static ref readonly
TensorSpan
<T> Ceiling<T>(scoped in ReadOnlyTensorSpan<T> x, in
TensorSpan
<T> destination)
3232
/// Copies <paramref name="source"/> to a new <see cref="
TensorSpan
{TTo}"/> converting each <typeparamref name="TFrom"/>
3235
/// <param name="source">The input <see cref="
TensorSpan
{TFrom}"/>.</param>
3237
public static ref readonly
TensorSpan
<TTo> ConvertChecked<TFrom, TTo>(scoped in ReadOnlyTensorSpan<TFrom> source, in
TensorSpan
<TTo> destination)
3263
/// Copies <paramref name="source"/> to a new <see cref="
TensorSpan
{TTo}"/> converting each <typeparamref name="TFrom"/>
3266
/// <param name="source">The input <see cref="
TensorSpan
{TFrom}"/>.</param>
3268
public static ref readonly
TensorSpan
<TTo> ConvertSaturating<TFrom, TTo>(scoped in ReadOnlyTensorSpan<TFrom> source, in
TensorSpan
<TTo> destination)
3294
/// Copies <paramref name="source"/> to a new <see cref="
TensorSpan
{TTo}"/> converting each <typeparamref name="TFrom"/>
3297
/// <param name="source">The input <see cref="
TensorSpan
{TFrom}"/>.</param>
3299
public static ref readonly
TensorSpan
<TTo> ConvertTruncating<TFrom, TTo>(scoped in ReadOnlyTensorSpan<TFrom> source, in
TensorSpan
<TTo> destination)
3342
public static ref readonly
TensorSpan
<T> CopySign<T>(scoped in ReadOnlyTensorSpan<T> x, T sign, in
TensorSpan
<T> destination)
3351
/// 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="
TensorSpan
{T}"/> with the result.
3356
public static ref readonly
TensorSpan
<T> CopySign<T>(scoped in ReadOnlyTensorSpan<T> x, scoped in ReadOnlyTensorSpan<T> sign, in
TensorSpan
<T> destination)
3379
/// Takes the cosine of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
TensorSpan
{T}"/> with the result.
3383
public static ref readonly
TensorSpan
<T> Cos<T>(scoped in ReadOnlyTensorSpan<T> x, in
TensorSpan
<T> destination)
3406
/// Takes the hyperbolic cosine of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
TensorSpan
{T}"/> with the result.
3410
public static ref readonly
TensorSpan
<T> Cosh<T>(scoped in ReadOnlyTensorSpan<T> x, in
TensorSpan
<T> destination)
3458
/// <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="
TensorSpan
{T}"/> with the results.</summary>
3473
public static ref readonly
TensorSpan
<T> CosPi<T>(scoped in ReadOnlyTensorSpan<T> x, in
TensorSpan
<T> destination)
3500
public static ref readonly
TensorSpan
<T> DegreesToRadians<T>(scoped in ReadOnlyTensorSpan<T> x, in
TensorSpan
<T> destination)
3567
/// Divides each element of <paramref name="x"/> by <paramref name="y"/> and returns a new <see cref="
TensorSpan
{T}"/> with the result.
3572
public static ref readonly
TensorSpan
<T> Divide<T>(scoped in ReadOnlyTensorSpan<T> x, T y, in
TensorSpan
<T> destination)
3581
/// Divides <paramref name="x"/> by each element of <paramref name="y"/> and returns a new <see cref="
TensorSpan
{T}"/> with the result."/>
3586
public static ref readonly
TensorSpan
<T> Divide<T>(T x, scoped in ReadOnlyTensorSpan<T> y, in
TensorSpan
<T> destination)
3596
/// a new <see cref="
TensorSpan
{T}"/> with the result.
3601
public static ref readonly
TensorSpan
<T> Divide<T>(scoped in ReadOnlyTensorSpan<T> x, scoped in ReadOnlyTensorSpan<T> y, in
TensorSpan
<T> destination)
3644
public static ref readonly
TensorSpan
<T> Exp<T>(scoped in ReadOnlyTensorSpan<T> x, in
TensorSpan
<T> destination)
3671
public static ref readonly
TensorSpan
<T> Exp10<T>(scoped in ReadOnlyTensorSpan<T> x, in
TensorSpan
<T> destination)
3694
public static ref readonly
TensorSpan
<T> Exp10M1<T>(scoped in ReadOnlyTensorSpan<T> x, in
TensorSpan
<T> destination)
3717
public static ref readonly
TensorSpan
<T> Exp2<T>(scoped in ReadOnlyTensorSpan<T> x, in
TensorSpan
<T> destination)
3740
public static ref readonly
TensorSpan
<T> Exp2M1<T>(scoped in ReadOnlyTensorSpan<T> x, in
TensorSpan
<T> destination)
3763
public static ref readonly
TensorSpan
<T> ExpM1<T>(scoped in ReadOnlyTensorSpan<T> x, in
TensorSpan
<T> destination)
3786
public static ref readonly
TensorSpan
<T> Floor<T>(scoped in ReadOnlyTensorSpan<T> x, in
TensorSpan
<T> destination)
3817
public static ref readonly
TensorSpan
<T> Hypot<T>(scoped in ReadOnlyTensorSpan<T> x, scoped in ReadOnlyTensorSpan<T> y, in
TensorSpan
<T> destination)
3844
public static ref readonly
TensorSpan
<T> Ieee754Remainder<T>(scoped in ReadOnlyTensorSpan<T> x, scoped in ReadOnlyTensorSpan<T> y, in
TensorSpan
<T> destination)
3867
public static ref readonly
TensorSpan
<T> Ieee754Remainder<T>(scoped in ReadOnlyTensorSpan<T> x, T y, in
TensorSpan
<T> destination)
3890
public static ref readonly
TensorSpan
<T> Ieee754Remainder<T>(T x, scoped in ReadOnlyTensorSpan<T> y, in
TensorSpan
<T> destination)
3913
public static ref readonly
TensorSpan
<int> ILogB<T>(scoped in ReadOnlyTensorSpan<T> x, in
TensorSpan
<int> destination)
3987
public static ref readonly
TensorSpan
<T> LeadingZeroCount<T>(scoped in ReadOnlyTensorSpan<T> x, in
TensorSpan
<T> destination)
4010
/// Takes the natural logarithm of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
TensorSpan
{T}"/> with the result.
4014
public static ref readonly
TensorSpan
<T> Log<T>(scoped in ReadOnlyTensorSpan<T> x, in
TensorSpan
<T> destination)
4037
public static ref readonly
TensorSpan
<T> Log<T>(scoped in ReadOnlyTensorSpan<T> x, scoped in ReadOnlyTensorSpan<T> y, in
TensorSpan
<T> destination)
4060
public static ref readonly
TensorSpan
<T> Log<T>(scoped in ReadOnlyTensorSpan<T> x, T y, in
TensorSpan
<T> destination)
4083
/// Takes the base 10 logarithm of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
TensorSpan
{T}"/> with the result.
4087
public static ref readonly
TensorSpan
<T> Log10<T>(scoped in ReadOnlyTensorSpan<T> x, in
TensorSpan
<T> destination)
4110
/// Takes the base 10 logarithm plus 1 of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
TensorSpan
{T}"/> with the result.
4114
public static ref readonly
TensorSpan
<T> Log10P1<T>(scoped in ReadOnlyTensorSpan<T> x, in
TensorSpan
<T> destination)
4137
/// Takes the base 2 logarithm of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
TensorSpan
{T}"/> with the result.
4141
public static ref readonly
TensorSpan
<T> Log2<T>(scoped in ReadOnlyTensorSpan<T> x, in
TensorSpan
<T> destination)
4164
/// Takes the base 2 logarithm plus 1 of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
TensorSpan
{T}"/> with the result.
4168
public static ref readonly
TensorSpan
<T> Log2P1<T>(scoped in ReadOnlyTensorSpan<T> x, in
TensorSpan
<T> destination)
4191
/// Takes the natural logarithm plus 1 of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
TensorSpan
{T}"/> with the result.
4195
public static ref readonly
TensorSpan
<T> LogP1<T>(scoped in ReadOnlyTensorSpan<T> x, in
TensorSpan
<T> destination)
4235
public static ref readonly
TensorSpan
<T> Max<T>(scoped in ReadOnlyTensorSpan<T> x, scoped in ReadOnlyTensorSpan<T> y, in
TensorSpan
<T> destination)
4258
public static ref readonly
TensorSpan
<T> Max<T>(scoped in ReadOnlyTensorSpan<T> x, T y, in
TensorSpan
<T> destination)
4298
public static ref readonly
TensorSpan
<T> MaxMagnitude<T>(scoped in ReadOnlyTensorSpan<T> x, scoped in ReadOnlyTensorSpan<T> y, in
TensorSpan
<T> destination)
4321
public static ref readonly
TensorSpan
<T> MaxMagnitude<T>(scoped in ReadOnlyTensorSpan<T> x, T y, in
TensorSpan
<T> destination)
4361
public static ref readonly
TensorSpan
<T> MaxMagnitudeNumber<T>(scoped in ReadOnlyTensorSpan<T> x, scoped in ReadOnlyTensorSpan<T> y, in
TensorSpan
<T> destination)
4384
public static ref readonly
TensorSpan
<T> MaxMagnitudeNumber<T>(scoped in ReadOnlyTensorSpan<T> x, T y, in
TensorSpan
<T> destination)
4424
public static ref readonly
TensorSpan
<T> MaxNumber<T>(scoped in ReadOnlyTensorSpan<T> x, scoped in ReadOnlyTensorSpan<T> y, in
TensorSpan
<T> destination)
4447
public static ref readonly
TensorSpan
<T> MaxNumber<T>(scoped in ReadOnlyTensorSpan<T> x, T y, in
TensorSpan
<T> destination)
4487
public static ref readonly
TensorSpan
<T> Min<T>(scoped in ReadOnlyTensorSpan<T> x, scoped in ReadOnlyTensorSpan<T> y, in
TensorSpan
<T> destination)
4510
public static ref readonly
TensorSpan
<T> Min<T>(scoped in ReadOnlyTensorSpan<T> x, T y, in
TensorSpan
<T> destination)
4550
public static ref readonly
TensorSpan
<T> MinMagnitude<T>(scoped in ReadOnlyTensorSpan<T> x, scoped in ReadOnlyTensorSpan<T> y, in
TensorSpan
<T> destination)
4573
public static ref readonly
TensorSpan
<T> MinMagnitude<T>(scoped in ReadOnlyTensorSpan<T> x, T y, in
TensorSpan
<T> destination)
4613
public static ref readonly
TensorSpan
<T> MinMagnitudeNumber<T>(scoped in ReadOnlyTensorSpan<T> x, scoped in ReadOnlyTensorSpan<T> y, in
TensorSpan
<T> destination)
4636
public static ref readonly
TensorSpan
<T> MinMagnitudeNumber<T>(scoped in ReadOnlyTensorSpan<T> x, T y, in
TensorSpan
<T> destination)
4676
public static ref readonly
TensorSpan
<T> MinNumber<T>(scoped in ReadOnlyTensorSpan<T> x, scoped in ReadOnlyTensorSpan<T> y, in
TensorSpan
<T> destination)
4699
public static ref readonly
TensorSpan
<T> MinNumber<T>(scoped in ReadOnlyTensorSpan<T> x, T y, in
TensorSpan
<T> destination)
4737
/// Multiplies each element of <paramref name="x"/> with <paramref name="y"/> and returns a new <see cref="
TensorSpan
{T}"/> with the result.
4742
public static ref readonly
TensorSpan
<T> Multiply<T>(scoped in ReadOnlyTensorSpan<T> x, T y, in
TensorSpan
<T> destination)
4751
/// Multiplies each element of <paramref name="x"/> with <paramref name="y"/> and returns a new <see cref="
TensorSpan
{T}"/> with the result.
4757
public static ref readonly
TensorSpan
<T> Multiply<T>(scoped in ReadOnlyTensorSpan<T> x, scoped in ReadOnlyTensorSpan<T> y, in
TensorSpan
<T> destination)
4780
public static ref readonly
TensorSpan
<T> Negate<T>(scoped in ReadOnlyTensorSpan<T> x, in
TensorSpan
<T> destination)
4817
public static ref readonly
TensorSpan
<T> OnesComplement<T>(scoped in ReadOnlyTensorSpan<T> y, in
TensorSpan
<T> destination)
4840
public static ref readonly
TensorSpan
<T> PopCount<T>(scoped in ReadOnlyTensorSpan<T> y, in
TensorSpan
<T> destination)
4865
public static ref readonly
TensorSpan
<T> Pow<T>(scoped in ReadOnlyTensorSpan<T> x, scoped in ReadOnlyTensorSpan<T> y, in
TensorSpan
<T> destination)
4888
public static ref readonly
TensorSpan
<T> Pow<T>(scoped in ReadOnlyTensorSpan<T> x, T y, in
TensorSpan
<T> destination)
4911
public static ref readonly
TensorSpan
<T> Pow<T>(T x, scoped in ReadOnlyTensorSpan<T> y, in
TensorSpan
<T> destination)
4946
public static ref readonly
TensorSpan
<T> RadiansToDegrees<T>(scoped in ReadOnlyTensorSpan<T> x, in
TensorSpan
<T> destination)
4969
public static ref readonly
TensorSpan
<T> Reciprocal<T>(scoped in ReadOnlyTensorSpan<T> x, in
TensorSpan
<T> destination)
4994
public static ref readonly
TensorSpan
<T> RootN<T>(scoped in ReadOnlyTensorSpan<T> x, int n, in
TensorSpan
<T> destination)
5021
public static ref readonly
TensorSpan
<T> RotateLeft<T>(scoped in ReadOnlyTensorSpan<T> x, int rotateAmount, in
TensorSpan
<T> destination)
5048
public static ref readonly
TensorSpan
<T> RotateRight<T>(scoped in ReadOnlyTensorSpan<T> x, int rotateAmount, in
TensorSpan
<T> destination)
5071
public static ref readonly
TensorSpan
<T> Round<T>(scoped in ReadOnlyTensorSpan<T> x, in
TensorSpan
<T> destination)
5096
public static ref readonly
TensorSpan
<T> Round<T>(scoped in ReadOnlyTensorSpan<T> x, int digits, MidpointRounding mode, in
TensorSpan
<T> destination)
5119
public static ref readonly
TensorSpan
<T> Round<T>(scoped in ReadOnlyTensorSpan<T> x, int digits, in
TensorSpan
<T> destination)
5142
public static ref readonly
TensorSpan
<T> Round<T>(scoped in ReadOnlyTensorSpan<T> x, MidpointRounding mode, in
TensorSpan
<T> destination)
5165
public static ref readonly
TensorSpan
<T> Sigmoid<T>(scoped in ReadOnlyTensorSpan<T> x, in
TensorSpan
<T> destination)
5188
/// Takes the sin of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
TensorSpan
{T}"/> with the result.
5192
public static ref readonly
TensorSpan
<T> Sin<T>(scoped in ReadOnlyTensorSpan<T> x, in
TensorSpan
<T> destination)
5215
public static ref readonly
TensorSpan
<T> Sinh<T>(scoped in ReadOnlyTensorSpan<T> x, in
TensorSpan
<T> destination)
5238
public static ref readonly
TensorSpan
<T> SinPi<T>(scoped in ReadOnlyTensorSpan<T> x, in
TensorSpan
<T> destination)
5264
public static ref readonly
TensorSpan
<T> SoftMax<T>(scoped in ReadOnlyTensorSpan<T> x, in
TensorSpan
<T> destination)
5290
/// Takes the square root of each element of the <paramref name="x"/> and returns a new <see cref="
TensorSpan
{T}"/> with the result.
5294
public static ref readonly
TensorSpan
<T> Sqrt<T>(scoped in ReadOnlyTensorSpan<T> x, in
TensorSpan
<T> destination)
5307
/// <param name="x">The <see cref="
TensorSpan
{T}"/> to take the standard deviation of.</param>
5362
/// Subtracts <paramref name="y"/> from each element of <paramref name="x"/> and returns a new <see cref="
TensorSpan
{T}"/> with the result.
5367
public static ref readonly
TensorSpan
<T> Subtract<T>(scoped in ReadOnlyTensorSpan<T> x, T y, in
TensorSpan
<T> destination)
5376
/// Subtracts each element of <paramref name="y"/> from <paramref name="x"/> and returns a new <see cref="
TensorSpan
{T}"/> with the result.
5381
public static ref readonly
TensorSpan
<T> Subtract<T>(T x, scoped in ReadOnlyTensorSpan<T> y, in
TensorSpan
<T> destination)
5390
/// Subtracts each element of <paramref name="x"/> from <paramref name="y"/> and returns a new <see cref="
TensorSpan
{T}"/> with the result.
5395
public static ref readonly
TensorSpan
<T> Subtract<T>(scoped in ReadOnlyTensorSpan<T> x, scoped in ReadOnlyTensorSpan<T> y, in
TensorSpan
<T> destination)
5448
public static ref readonly
TensorSpan
<T> Tan<T>(scoped in ReadOnlyTensorSpan<T> x, in
TensorSpan
<T> destination)
5471
public static ref readonly
TensorSpan
<T> Tanh<T>(scoped in ReadOnlyTensorSpan<T> x, in
TensorSpan
<T> destination)
5494
public static ref readonly
TensorSpan
<T> TanPi<T>(scoped in ReadOnlyTensorSpan<T> x, in
TensorSpan
<T> destination)
5517
public static ref readonly
TensorSpan
<T> TrailingZeroCount<T>(scoped in ReadOnlyTensorSpan<T> x, in
TensorSpan
<T> destination)
5540
public static ref readonly
TensorSpan
<T> Truncate<T>(scoped in ReadOnlyTensorSpan<T> x, in
TensorSpan
<T> destination)
5565
public static ref readonly
TensorSpan
<T> Xor<T>(scoped in ReadOnlyTensorSpan<T> x, scoped in ReadOnlyTensorSpan<T> y, in
TensorSpan
<T> destination)
5587
/// Computes the element-wise Xor of the two input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
TensorSpan
{T}"/> with the result.
5592
public static ref readonly
TensorSpan
<T> Xor<T>(scoped in ReadOnlyTensorSpan<T> x, T y, in
TensorSpan
<T> destination)
System\Numerics\Tensors\netcore\Tensor_1.cs (15)
125
/// <inheritdoc cref="
TensorSpan
{T}.this[ReadOnlySpan{nint}]" />
131
/// <inheritdoc cref="
TensorSpan
{T}.this[ReadOnlySpan{NIndex}]" />
137
/// <inheritdoc cref="
TensorSpan
{T}.this[ReadOnlySpan{NRange}]" />
176
public static implicit operator
TensorSpan
<T>(Tensor<T> tensor) => tensor.AsTensorSpan();
178
/// <inheritdoc cref="
TensorSpan
{T}.implicit operator ReadOnlyTensorSpan{T}(in
TensorSpan
{T})" />
194
public
TensorSpan
<T> AsTensorSpan() => new TensorSpan<T>(ref Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(_values), _start), in _shape);
197
public
TensorSpan
<T> AsTensorSpan(params scoped ReadOnlySpan<nint> startIndexes) => AsTensorSpan().Slice(startIndexes);
200
public
TensorSpan
<T> AsTensorSpan(params scoped ReadOnlySpan<NIndex> startIndexes) => AsTensorSpan().Slice(startIndexes);
203
public
TensorSpan
<T> AsTensorSpan(params scoped ReadOnlySpan<NRange> ranges) => AsTensorSpan().Slice(ranges);
208
/// <inheritdoc cref="IReadOnlyTensor{TSelf, T}.CopyTo(in
TensorSpan
{T})" />
209
public void CopyTo(scoped in
TensorSpan
<T> destination)
311
/// <inheritdoc cref="IReadOnlyTensor{TSelf, T}.TryCopyTo(in
TensorSpan
{T})" />
312
public bool TryCopyTo(scoped in
TensorSpan
<T> destination) => AsReadOnlyTensorSpan().TryCopyTo(destination);
318
/// Creates a <see cref="string"/> representation of the <see cref="
TensorSpan
{T}"/>."/>
System\Numerics\Tensors\netcore\TensorOperation.cs (12)
13
public static void Invoke<TOperation, T>(in
TensorSpan
<T> x)
89
public static void Invoke<TOperation, TArg, TResult>(in
TensorSpan
<TResult> destination, TArg scalar)
106
public static void Invoke<TOperation, TArg, TResult>(in ReadOnlyTensorSpan<TArg> x, in
TensorSpan
<TResult> destination)
127
public static void ReverseInvoke<TOperation, TArg, TResult>(in ReadOnlyTensorSpan<TArg> x, in
TensorSpan
<TResult> destination)
194
public static void Invoke<TOperation, TArg1, TArg2, TResult>(in ReadOnlyTensorSpan<TArg1> x, in ReadOnlyTensorSpan<TArg2> y, in
TensorSpan
<TResult> destination)
219
public static void Invoke<TOperation, TArg, TResult>(in ReadOnlyTensorSpan<TArg> x, in ReadOnlyTensorSpan<TArg> y, in
TensorSpan
<TResult> destination)
248
public static void Invoke<TOperation, TArg, TResult>(in ReadOnlyTensorSpan<TArg> x, TArg y, in
TensorSpan
<TResult> destination)
252
public static void Invoke<TOperation, TArg, TResult>(in ReadOnlyTensorSpan<TArg> x, int y, in
TensorSpan
<TResult> destination)
255
public static void Invoke<TOperation, TArg1, TArg2, TResult>(in ReadOnlyTensorSpan<TArg1> x, TArg2 y, in
TensorSpan
<TResult> destination)
277
public static void Invoke<TOperation, TArg, TResult>(TArg x, in ReadOnlyTensorSpan<TArg> y, in
TensorSpan
<TResult> destination)
335
public static void ValidateCompatibility<TArg, TResult>(in ReadOnlyTensorSpan<TArg> x, in
TensorSpan
<TResult> destination)
342
public static void ValidateCompatibility<TArg1, TArg2, TResult>(in ReadOnlyTensorSpan<TArg1> x, in ReadOnlyTensorSpan<TArg2> y, in
TensorSpan
<TResult> destination)
System\Numerics\Tensors\netcore\TensorSpan.cs (17)
27
public static
TensorSpan
<T> Empty => default;
195
public
TensorSpan
<T> this[params scoped ReadOnlySpan<NRange> ranges]
225
public static bool operator ==(in
TensorSpan
<T> left, in
TensorSpan
<T> right)
230
public static bool operator !=(in
TensorSpan
<T> left, in
TensorSpan
<T> right) => !(left == right);
235
public static implicit operator
TensorSpan
<T>(T[]? array) => new TensorSpan<T>(array);
240
public static implicit operator ReadOnlyTensorSpan<T>(scoped in
TensorSpan
<T> tensor) =>
258
/// <inheritdoc cref="IReadOnlyTensor{TSelf, T}.CopyTo(in
TensorSpan
{T})" />
259
public void CopyTo(scoped in
TensorSpan
<T> destination)
305
public
TensorSpan
<T> Slice(params scoped ReadOnlySpan<nint> startIndexes)
315
public
TensorSpan
<T> Slice(params scoped ReadOnlySpan<NIndex> startIndexes)
325
public
TensorSpan
<T> Slice(params scoped ReadOnlySpan<NRange> ranges)
337
/// <inheritdoc cref="IReadOnlyTensor{TSelf, T}.TryCopyTo(in
TensorSpan
{T})" />
338
public bool TryCopyTo(scoped in
TensorSpan
<T> destination) => AsReadOnlyTensorSpan().TryCopyTo(destination);
346
private readonly
TensorSpan
<T> _span;
351
internal Enumerator(
TensorSpan
<T> span)
System\Numerics\Tensors\netcore\TensorSpanDebugView.cs (1)
15
public TensorSpanDebugView(
TensorSpan
<T> span)