19 instantiations of Tensor
System.Numerics.Tensors (19)
System\Numerics\Tensors\netcore\Tensor_1.cs (4)
21
public static Tensor<T> Empty { get; } =
new
();
228
return new
Tensor
<T>(
243
return new
Tensor
<T>(
258
return new
Tensor
<T>(
System\Numerics\Tensors\netcore\Tensor.cs (15)
482
=> new
Tensor
<T>(array);
487
=> new
Tensor
<T>(array, lengths, strides: []);
492
=> new
Tensor
<T>(array, lengths, strides);
497
=> new
Tensor
<T>(array, start, lengths, strides);
504
=> new
Tensor
<T>(lengths, strides: [], pinned);
509
=> new
Tensor
<T>(lengths, strides, pinned);
520
return new
Tensor
<T>(values, in shape);
1585
Tensor<T> result = new
Tensor
<T>(tensor._values, tensor._start, newLengths, newStrides, tensor.IsPinned);
1704
return new
Tensor
<T>(tensor._values, tensor._start, reshaped._shape);
1717
Tensor<T> result = new
Tensor
<T>(tensor._values, tensor._start, newLengths, strides, tensor.IsPinned);
2438
outputs[i] = new
Tensor
<T>(values, newLengths, strides: []);
2522
Tensor<T> output = new
Tensor
<T>(tensor._values, tensor._start, lengths[..rank], strides[..rank], tensor.IsPinned);
2992
Tensor<T> output = new
Tensor
<T>(tensor._values, tensor._start, lengths, strides, tensor.IsPinned);
3053
return new
Tensor
<T>(tensor._values, tensor._start, unsqueezed._shape);
3087
Tensor<T> output = new
Tensor
<T>(tensor._values, tensor._start, newLengths, newStrides, tensor.IsPinned);
606 references to Tensor
System.Numerics.Tensors (606)
System\Numerics\Tensors\netcore\ReadOnlyTensorSpan_1.cs (1)
534
Tensor
<T> tmp = Tensor.CreateFromShape<T>(Lengths, IsPinned);
System\Numerics\Tensors\netcore\Tensor_1.cs (27)
18
public sealed class Tensor<T> : ITensor<
Tensor
<T>, T>, IEnumerable<T>
21
public static
Tensor
<T> Empty { get; } = new();
96
public
Tensor
<T> this[params ReadOnlySpan<NRange> ranges]
129
public static implicit operator
Tensor
<T>(T[] array) => Tensor.Create(array);
134
public static implicit operator TensorSpan<T>(
Tensor
<T> tensor) => tensor.AsTensorSpan();
137
public static implicit operator ReadOnlyTensorSpan<T>(
Tensor
<T> tensor) => tensor.AsReadOnlyTensorSpan();
221
public
Tensor
<T> Slice(params ReadOnlySpan<nint> startIndexes)
236
public
Tensor
<T> Slice(params ReadOnlySpan<NIndex> startIndexes)
251
public
Tensor
<T> Slice(params ReadOnlySpan<NRange> ranges)
266
public
Tensor
<T> ToDenseTensor()
268
Tensor
<T> result = this;
327
ref readonly T IReadOnlyTensor<
Tensor
<T>, T>.this[params ReadOnlySpan<nint> indexes] => ref this[indexes];
329
ref readonly T IReadOnlyTensor<
Tensor
<T>, T>.this[params ReadOnlySpan<NIndex> indexes] => ref this[indexes];
331
ReadOnlyTensorDimensionSpan<T> IReadOnlyTensor<
Tensor
<T>, T>.GetDimensionSpan(int dimension) => AsReadOnlyTensorSpan().GetDimensionSpan(dimension);
333
ref readonly T IReadOnlyTensor<
Tensor
<T>, T>.GetPinnableReference() => ref GetPinnableReference();
335
ReadOnlySpan<T> IReadOnlyTensor<
Tensor
<T>, T>.GetSpan(scoped ReadOnlySpan<nint> startIndexes, int length) => AsReadOnlyTensorSpan().GetSpan(startIndexes, length);
337
ReadOnlySpan<T> IReadOnlyTensor<
Tensor
<T>, T>.GetSpan(scoped ReadOnlySpan<NIndex> startIndexes, int length) => AsReadOnlyTensorSpan().GetSpan(startIndexes, length);
371
static
Tensor
<T> ITensor<
Tensor
<T>, T>.CreateFromShape(scoped ReadOnlySpan<nint> lengths, bool pinned) => Tensor.CreateFromShape<T>(lengths, pinned);
373
static
Tensor
<T> ITensor<
Tensor
<T>, T>.CreateFromShape(scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides, bool pinned) => Tensor.CreateFromShape<T>(lengths, strides, pinned);
375
static
Tensor
<T> ITensor<
Tensor
<T>, T>.CreateFromShapeUninitialized(scoped ReadOnlySpan<nint> lengths, bool pinned) => Tensor.CreateFromShapeUninitialized<T>(lengths, pinned);
377
static
Tensor
<T> ITensor<
Tensor
<T>, T>.CreateFromShapeUninitialized(scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides, bool pinned) => Tensor.CreateFromShapeUninitialized<T>(lengths, strides, pinned);
382
private readonly
Tensor
<T> _tensor;
387
internal Enumerator(
Tensor
<T> tensor)
System\Numerics\Tensors\netcore\Tensor.cs (399)
52
/// Broadcast the data from <paramref name="source"/> to the smallest broadcastable shape compatible with <paramref name="lengthsSource"/>. Creates a new <see cref="
Tensor
{T}"/> and allocates new memory.
54
/// <param name="source">Input <see cref="
Tensor
{T}"/>.</param>
55
/// <param name="lengthsSource">Other <see cref="
Tensor
{T}"/> to make shapes broadcastable.</param>
57
public static
Tensor
<T> Broadcast<T>(scoped in ReadOnlyTensorSpan<T> source, scoped in ReadOnlyTensorSpan<T> lengthsSource)
63
/// 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.
66
/// <param name="source">Input <see cref="
Tensor
{T}"/>.</param>
70
public static
Tensor
<T> Broadcast<T>(scoped in ReadOnlyTensorSpan<T> source, scoped ReadOnlySpan<nint> lengths)
73
Tensor
<T> destination = CreateFromShapeUninitialized<T>(lengths);
85
public static void BroadcastTo<T>(this
Tensor
<T> source, in TensorSpan<T> destination)
118
public static
Tensor
<T> Concatenate<T>(params scoped ReadOnlySpan<
Tensor
<T>> tensors)
129
public static
Tensor
<T> ConcatenateOnDimension<T>(int dimension, params scoped ReadOnlySpan<
Tensor
<T>> tensors)
143
Tensor
<T> tensor;
176
public static ref readonly TensorSpan<T> Concatenate<T>(scoped ReadOnlySpan<
Tensor
<T>> tensors, in TensorSpan<T> destination)
188
public static ref readonly TensorSpan<T> ConcatenateOnDimension<T>(int dimension, scoped ReadOnlySpan<
Tensor
<T>> tensors, in TensorSpan<T> destination)
239
private static
Tensor
<T> CreateConcatenationResult<T>(ReadOnlySpan<nint> sourceLengths, int dimension, nint axisLength)
243
Tensor
<T> result;
258
private static void ValidateConcatenationStorage<T>(scoped ReadOnlySpan<
Tensor
<T>> tensors, in TensorSpan<T> destination)
281
private static void CopyConcatenatedValues<T>(int dimension, scoped ReadOnlySpan<
Tensor
<T>> tensors,
308
foreach (
Tensor
<T> tensor in tensors)
320
foreach (
Tensor
<T> tensor in tensors)
342
private static nint GetConcatenatedLength<T>(int dimension, scoped ReadOnlySpan<
Tensor
<T>> tensors, in TensorShape shape)
360
private static bool TryJoinDenseBlocks<T>(int dimension, ReadOnlySpan<
Tensor
<T>> tensors,
367
foreach (
Tensor
<T> tensor in tensors)
390
foreach (
Tensor
<T> tensor in tensors)
433
private static void ConcatenateOnDimensionToSpan<T>(int dimension, scoped ReadOnlySpan<
Tensor
<T>> tensors, in TensorSpan<T> destination, Span<T> dstSpan)
481
public static
Tensor
<T> Create<T>(T[] array)
486
public static
Tensor
<T> Create<T>(T[] array, scoped ReadOnlySpan<nint> lengths)
491
public static
Tensor
<T> Create<T>(T[] array, scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides)
496
public static
Tensor
<T> Create<T>(T[] array, int start, scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides)
503
public static
Tensor
<T> CreateFromShape<T>(scoped ReadOnlySpan<nint> lengths, bool pinned = false)
508
public static
Tensor
<T> CreateFromShape<T>(scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides, bool pinned = false)
512
public static
Tensor
<T> CreateFromShapeUninitialized<T>(scoped ReadOnlySpan<nint> lengths, bool pinned = false)
516
public static
Tensor
<T> CreateFromShapeUninitialized<T>(scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides, bool pinned = false)
655
public static
Tensor
<bool> Equals<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
658
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<bool> destination);
686
public static
Tensor
<bool> Equals<T>(in ReadOnlyTensorSpan<T> x, T y)
689
Tensor
<bool> destination = CreateFromShapeUninitialized<bool>(x.Lengths);
775
/// <param name="tensor">Input <see cref="
Tensor
{T}"/>.</param>
789
/// <param name="tensor">Input <see cref="
Tensor
{T}"/>.</param>
804
/// 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>A <see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/> and
811
public static
Tensor
<bool> GreaterThan<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
814
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<bool> destination);
822
/// 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"/>
828
/// <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
840
/// 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"/>
845
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/>
847
public static
Tensor
<bool> GreaterThan<T>(in ReadOnlyTensorSpan<T> x, T y)
850
Tensor
<bool> destination = CreateFromShape<bool>(x.Lengths, false);
857
/// 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"/>
863
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/>
875
/// 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"/>
880
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/>
882
public static
Tensor
<bool> GreaterThan<T>(T x, in ReadOnlyTensorSpan<T> y)
887
/// 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"/>
893
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/>
985
/// 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"/>
990
/// <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
992
public static
Tensor
<bool> GreaterThanOrEqual<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
995
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<bool> destination);
1003
/// 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"/>
1009
/// <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
1021
/// 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"/>
1026
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/>
1028
public static
Tensor
<bool> GreaterThanOrEqual<T>(in ReadOnlyTensorSpan<T> x, T y)
1031
Tensor
<bool> destination = CreateFromShape<bool>(x.Lengths, false);
1038
/// 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"/>
1044
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/>
1056
/// 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"/>
1061
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/>
1063
public static
Tensor
<bool> GreaterThanOrEqual<T>(T x, in ReadOnlyTensorSpan<T> y)
1068
/// 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"/>
1074
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/>
1166
/// 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"/>
1171
/// <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
1173
public static
Tensor
<bool> LessThan<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
1176
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<bool> destination);
1184
/// 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"/>
1190
/// <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
/// Compares the elements of a <see cref="
Tensor
{T}"/> to see which elements are less than <paramref name="y"/>.
1202
/// 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"/>
1205
/// <param name="x"><see cref="
Tensor
{T}"/> to compare.</param>
1207
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/>
1209
public static
Tensor
<bool> LessThan<T>(in ReadOnlyTensorSpan<T> x, T y)
1212
Tensor
<bool> destination = CreateFromShape<bool>(x.Lengths, false);
1218
/// Compares the elements of a <see cref="
Tensor
{T}"/> to see which elements are less than <paramref name="y"/>.
1219
/// 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"/>
1222
/// <param name="x"><see cref="
Tensor
{T}"/> to compare.</param>
1225
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/>
1236
/// Compares the elements of a <see cref="
Tensor
{T}"/> to see which elements are less than <paramref name="y"/>.
1237
/// 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"/>
1240
/// <param name="x"><see cref="
Tensor
{T}"/> to compare.</param>
1242
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/>
1244
public static
Tensor
<bool> LessThan<T>(T x, in ReadOnlyTensorSpan<T> y)
1248
/// Compares the elements of a <see cref="
Tensor
{T}"/> to see which elements are less than <paramref name="y"/>.
1249
/// 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"/>
1252
/// <param name="x"><see cref="
Tensor
{T}"/> to compare.</param>
1255
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/>
1347
/// 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"/>
1352
/// <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
1354
public static
Tensor
<bool> LessThanOrEqual<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
1357
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<bool> destination);
1365
/// 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"/>
1371
/// <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
1382
/// Compares the elements of a <see cref="
Tensor
{T}"/> to see which elements are less than <paramref name="y"/>.
1383
/// 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"/>
1386
/// <param name="x"><see cref="
Tensor
{T}"/> to compare.</param>
1388
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/>
1390
public static
Tensor
<bool> LessThanOrEqual<T>(in ReadOnlyTensorSpan<T> x, T y)
1393
Tensor
<bool> destination = CreateFromShape<bool>(x.Lengths, false);
1399
/// Compares the elements of a <see cref="
Tensor
{T}"/> to see which elements are less than <paramref name="y"/>.
1400
/// 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"/>
1403
/// <param name="x"><see cref="
Tensor
{T}"/> to compare.</param>
1406
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/>
1417
/// Compares the elements of a <see cref="
Tensor
{T}"/> to see which elements are less than <paramref name="y"/>.
1418
/// 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"/>
1421
/// <param name="x"><see cref="
Tensor
{T}"/> to compare.</param>
1423
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/>
1425
public static
Tensor
<bool> LessThanOrEqual<T>(T x, in ReadOnlyTensorSpan<T> y)
1429
/// Compares the elements of a <see cref="
Tensor
{T}"/> to see which elements are less than <paramref name="y"/>.
1430
/// 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"/>
1433
/// <param name="x"><see cref="
Tensor
{T}"/> to compare.</param>
1436
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/>
1528
/// If <paramref name="tensor"/> is a 1D tensor, it will return <paramref name="tensor"/>. Otherwise it creates a new <see cref="
Tensor
{T}"/>
1531
/// <param name="tensor">Input <see cref="
Tensor
{T}"/></param>
1533
public static
Tensor
<T> PermuteDimensions<T>(this
Tensor
<T> tensor, ReadOnlySpan<int> dimensions)
1585
Tensor
<T> result = new Tensor<T>(tensor._values, tensor._start, newLengths, newStrides, tensor.IsPinned);
1692
/// <param name="tensor"><see cref="
Tensor
{T}"/> you want to reshape.</param>
1694
public static
Tensor
<T> Reshape<T>(this
Tensor
<T> tensor, ReadOnlySpan<nint> lengths)
1717
Tensor
<T> result = new Tensor<T>(tensor._values, tensor._start, newLengths, strides, tensor.IsPinned);
1791
/// 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
1794
/// <param name="tensor">Input <see cref="
Tensor
{T}"/>.</param>
1796
public static
Tensor
<T> Resize<T>(
Tensor
<T> tensor, ReadOnlySpan<nint> lengths)
1798
Tensor
<T> output = CreateFromShape<T>(lengths, tensor.IsPinned);
1840
/// <param name="tensor">Input <see cref="
Tensor
{T}"/>.</param>
1842
public static void ResizeTo<T>(scoped in
Tensor
<T> tensor, in TensorSpan<T> destination)
1993
/// <param name="tensor">Input <see cref="
Tensor
{T}"/>.</param>
1994
public static
Tensor
<T> Reverse<T>(in ReadOnlyTensorSpan<T> tensor)
1996
Tensor
<T> output = CreateFromShape<T>(tensor.Lengths);
2006
/// <param name="tensor">Input <see cref="
Tensor
{T}"/>.</param>
2008
public static
Tensor
<T> ReverseDimension<T>(in ReadOnlyTensorSpan<T> tensor, int dimension)
2010
Tensor
<T> output = CreateFromShape<T>(tensor.Lengths);
2365
/// <param name="tensor">Input <see cref="
Tensor
{T}"/>.</param>
2368
public static
Tensor
<T> SetSlice<T>(this
Tensor
<T> tensor, in ReadOnlyTensorSpan<T> values, params ReadOnlySpan<NRange> ranges)
2377
/// <param name="tensor">Input <see cref="
Tensor
{T}"/>.</param>
2396
/// Split a <see cref="
Tensor
{T}"/> into <paramref name="splitCount"/> along the given <paramref name="dimension"/>. If the tensor cannot be split
2399
/// <param name="tensor">Input <see cref="
Tensor
{T}"/>.</param>
2404
public static
Tensor
<T>[] Split<T>(scoped in ReadOnlyTensorSpan<T> tensor, int splitCount, nint dimension)
2419
Tensor
<T>[] outputs = new
Tensor
<T>[splitCount];
2454
/// <param name="tensor">The <see cref="
Tensor
{T}"/> to remove all dimensions of length 1.</param>
2455
public static
Tensor
<T> Squeeze<T>(this
Tensor
<T> tensor)
2464
/// <param name="tensor">The <see cref="
Tensor
{T}"/> to remove dimension of length 1.</param>
2466
public static
Tensor
<T> SqueezeDimension<T>(this
Tensor
<T> tensor, int dimension)
2522
Tensor
<T> output = new Tensor<T>(tensor._values, tensor._start, lengths[..rank], strides[..rank], tensor.IsPinned);
2691
/// Join multiple <see cref="
Tensor
{T}"/> along a new dimension that is added at position 0. All tensors must have equivalent shapes.
2693
/// <param name="tensors">Input <see cref="
Tensor
{T}"/>.</param>
2695
public static
Tensor
<T> Stack<T>(params ReadOnlySpan<
Tensor
<T>> tensors)
2701
/// Join multiple <see cref="
Tensor
{T}"/> along a new dimension. The axis parameter specifies the index of the new dimension. All tensors must have equivalent shapes.
2703
/// <param name="tensors">Input <see cref="
Tensor
{T}"/>.</param>
2706
public static
Tensor
<T> StackAlongDimension<T>(int dimension, params ReadOnlySpan<
Tensor
<T>> tensors)
2715
Tensor
<T> result = CreateFromShape<T>(lengths);
2722
/// Join multiple <see cref="
Tensor
{T}"/> along a new dimension that is added at position 0. All tensors must have equivalent shapes.
2724
/// <param name="tensors">Input <see cref="
Tensor
{T}"/>.</param>
2727
public static ref readonly TensorSpan<T> Stack<T>(scoped in ReadOnlySpan<
Tensor
<T>> tensors, in TensorSpan<T> destination)
2733
/// Join multiple <see cref="
Tensor
{T}"/> along a new dimension. The axis parameter specifies the index of the new dimension. All tensors must have equivalent shapes.
2735
/// <param name="tensors">Input <see cref="
Tensor
{T}"/>.</param>
2739
public static ref readonly TensorSpan<T> StackAlongDimension<T>(scoped ReadOnlySpan<
Tensor
<T>> tensors, in TensorSpan<T> destination, int dimension)
2755
private static int ValidateStackInputs<T>(int dimension, scoped ReadOnlySpan<
Tensor
<T>> tensors)
2782
private static void CopyStackValues<T>(int dimension, scoped ReadOnlySpan<
Tensor
<T>> tensors,
2972
/// <param name="tensor">Input <see cref="
Tensor
{T}"/>.</param>
2973
public static
Tensor
<T> Transpose<T>(
Tensor
<T> tensor)
2992
Tensor
<T> output = new Tensor<T>(tensor._values, tensor._start, lengths, strides, tensor.IsPinned);
3006
/// <param name="tensor">Input <see cref="
Tensor
{T}"/>.</param>
3008
public static bool TryBroadcastTo<T>(this
Tensor
<T> tensor, in TensorSpan<T> destination)
3046
/// <param name="tensor">The <see cref="
Tensor
{T}"/> to add a dimension of length 1.</param>
3048
public static
Tensor
<T> Unsqueeze<T>(this
Tensor
<T> tensor, int dimension)
3087
Tensor
<T> output = new Tensor<T>(tensor._values, tensor._start, newLengths, newStrides, tensor.IsPinned);
3187
/// Takes the absolute value of each element of the <see cref="
Tensor
{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
3190
public static
Tensor
<T> Abs<T>(in ReadOnlyTensorSpan<T> x)
3193
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
3214
/// Takes the inverse cosine of each element of the <see cref="
Tensor
{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
3217
public static
Tensor
<T> Acos<T>(in ReadOnlyTensorSpan<T> x)
3220
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
3226
/// Takes the inverse cosine of each element of the <see cref="
Tensor
{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
3241
/// 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.
3244
public static
Tensor
<T> Acosh<T>(in ReadOnlyTensorSpan<T> x)
3247
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
3268
/// 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.
3271
public static
Tensor
<T> AcosPi<T>(in ReadOnlyTensorSpan<T> x)
3274
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
3295
/// Takes the inverse sin of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
3298
public static
Tensor
<T> Asin<T>(in ReadOnlyTensorSpan<T> x)
3301
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
3322
/// 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.
3325
public static
Tensor
<T> Asinh<T>(in ReadOnlyTensorSpan<T> x)
3328
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
3349
/// 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.
3352
public static
Tensor
<T> AsinPi<T>(in ReadOnlyTensorSpan<T> x)
3355
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
3376
/// Takes the arc tangent of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
3379
public static
Tensor
<T> Atan<T>(in ReadOnlyTensorSpan<T> x)
3382
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
3403
/// Takes the arc tangent of the two input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
3407
public static
Tensor
<T> Atan2<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
3410
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<T> destination);
3430
/// Takes the arc tangent of the two input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
3434
public static
Tensor
<T> Atan2<T>(in ReadOnlyTensorSpan<T> x, T y)
3437
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
3457
/// Takes the arc tangent of the two input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
3461
public static
Tensor
<T> Atan2<T>(T x, in ReadOnlyTensorSpan<T> y)
3464
Tensor
<T> destination = CreateFromShapeUninitialized<T>(y.Lengths);
3486
/// 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.
3490
public static
Tensor
<T> Atan2Pi<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
3493
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<T> destination);
3517
public static
Tensor
<T> Atan2Pi<T>(in ReadOnlyTensorSpan<T> x, T y)
3520
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
3544
public static
Tensor
<T> Atan2Pi<T>(T x, in ReadOnlyTensorSpan<T> y)
3547
Tensor
<T> destination = CreateFromShapeUninitialized<T>(y.Lengths);
3569
/// 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.
3572
public static
Tensor
<T> Atanh<T>(in ReadOnlyTensorSpan<T> x)
3575
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
3596
/// 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.
3599
public static
Tensor
<T> AtanPi<T>(in ReadOnlyTensorSpan<T> x)
3602
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
3640
/// Computes the element-wise cube root of the input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
3643
public static
Tensor
<T> Cbrt<T>(in ReadOnlyTensorSpan<T> x)
3646
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
3667
/// Computes the element-wise ceiling of the input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
3670
public static
Tensor
<T> Ceiling<T>(in ReadOnlyTensorSpan<T> x)
3673
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
3698
public static
Tensor
<TTo> ConvertChecked<TFrom, TTo>(in ReadOnlyTensorSpan<TFrom> source)
3702
Tensor
<TTo> destination = CreateFromShapeUninitialized<TTo>(source.Lengths);
3729
public static
Tensor
<TTo> ConvertSaturating<TFrom, TTo>(in ReadOnlyTensorSpan<TFrom> source)
3733
Tensor
<TTo> destination = CreateFromShapeUninitialized<TTo>(source.Lengths);
3760
public static
Tensor
<TTo> ConvertTruncating<TFrom, TTo>(in ReadOnlyTensorSpan<TFrom> source)
3764
Tensor
<TTo> destination = CreateFromShapeUninitialized<TTo>(source.Lengths);
3791
public static
Tensor
<T> CopySign<T>(in ReadOnlyTensorSpan<T> x, T sign)
3794
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
3800
/// 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.
3804
public static
Tensor
<T> CopySign<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> sign)
3807
TensorOperation.ValidateCompatibility(x, sign, out
Tensor
<T> destination);
3843
/// Takes the cosine of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
3846
public static
Tensor
<T> Cos<T>(in ReadOnlyTensorSpan<T> x)
3849
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
3870
/// Takes the hyperbolic cosine of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
3873
public static
Tensor
<T> Cosh<T>(in ReadOnlyTensorSpan<T> x)
3876
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
3912
/// <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>
3926
public static
Tensor
<T> CosPi<T>(in ReadOnlyTensorSpan<T> x)
3929
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
3963
public static
Tensor
<T> DegreesToRadians<T>(in ReadOnlyTensorSpan<T> x)
3966
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
4022
public static
Tensor
<T> Exp<T>(in ReadOnlyTensorSpan<T> x)
4025
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
4049
public static
Tensor
<T> Exp10<T>(in ReadOnlyTensorSpan<T> x)
4052
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
4074
public static
Tensor
<T> Exp10M1<T>(in ReadOnlyTensorSpan<T> x)
4077
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
4097
public static
Tensor
<T> Exp2<T>(in ReadOnlyTensorSpan<T> x)
4100
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
4120
public static
Tensor
<T> Exp2M1<T>(in ReadOnlyTensorSpan<T> x)
4123
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
4143
public static
Tensor
<T> ExpM1<T>(in ReadOnlyTensorSpan<T> x)
4146
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
4166
public static
Tensor
<T> Floor<T>(in ReadOnlyTensorSpan<T> x)
4169
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
4193
public static
Tensor
<T> Hypot<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
4196
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<T> destination);
4222
public static
Tensor
<T> Ieee754Remainder<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
4225
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<T> destination);
4246
public static
Tensor
<T> Ieee754Remainder<T>(in ReadOnlyTensorSpan<T> x, T y)
4249
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
4269
public static
Tensor
<T> Ieee754Remainder<T>(T x, in ReadOnlyTensorSpan<T> y)
4272
Tensor
<T> destination = CreateFromShapeUninitialized<T>(y.Lengths);
4293
public static
Tensor
<int> ILogB<T>(in ReadOnlyTensorSpan<T> x)
4296
Tensor
<int> destination = CreateFromShapeUninitialized<int>(x.Lengths);
4361
public static
Tensor
<T> LeadingZeroCount<T>(in ReadOnlyTensorSpan<T> x)
4364
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
4385
/// Takes the natural logarithm of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
4388
public static
Tensor
<T> Log<T>(in ReadOnlyTensorSpan<T> x)
4391
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
4412
public static
Tensor
<T> Log<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
4415
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<T> destination);
4435
public static
Tensor
<T> Log<T>(in ReadOnlyTensorSpan<T> x, T y)
4438
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
4458
/// 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.
4461
public static
Tensor
<T> Log10<T>(in ReadOnlyTensorSpan<T> x)
4464
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
4485
/// 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.
4488
public static
Tensor
<T> Log10P1<T>(in ReadOnlyTensorSpan<T> x)
4491
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
4512
/// 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.
4515
public static
Tensor
<T> Log2<T>(in ReadOnlyTensorSpan<T> x)
4518
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
4539
/// 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.
4542
public static
Tensor
<T> Log2P1<T>(in ReadOnlyTensorSpan<T> x)
4545
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
4566
/// 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.
4569
public static
Tensor
<T> LogP1<T>(in ReadOnlyTensorSpan<T> x)
4572
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
4610
public static
Tensor
<T> Max<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
4613
TensorOperation.ValidateCompatibility(in x, in y, out
Tensor
<T> output);
4633
public static
Tensor
<T> Max<T>(in ReadOnlyTensorSpan<T> x, T y)
4636
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
4673
public static
Tensor
<T> MaxMagnitude<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
4676
TensorOperation.ValidateCompatibility(in x, in y, out
Tensor
<T> destination);
4696
public static
Tensor
<T> MaxMagnitude<T>(in ReadOnlyTensorSpan<T> x, T y)
4699
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
4736
public static
Tensor
<T> MaxMagnitudeNumber<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
4739
TensorOperation.ValidateCompatibility(in x, in y, out
Tensor
<T> destination);
4759
public static
Tensor
<T> MaxMagnitudeNumber<T>(in ReadOnlyTensorSpan<T> x, T y)
4762
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
4799
public static
Tensor
<T> MaxNumber<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
4802
TensorOperation.ValidateCompatibility(in x, in y, out
Tensor
<T> destination);
4822
public static
Tensor
<T> MaxNumber<T>(in ReadOnlyTensorSpan<T> x, T y)
4825
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
4862
public static
Tensor
<T> Min<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
4865
TensorOperation.ValidateCompatibility(in x, in y, out
Tensor
<T> output);
4885
public static
Tensor
<T> Min<T>(in ReadOnlyTensorSpan<T> x, T y)
4888
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
4925
public static
Tensor
<T> MinMagnitude<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
4928
TensorOperation.ValidateCompatibility(in x, in y, out
Tensor
<T> destination);
4948
public static
Tensor
<T> MinMagnitude<T>(in ReadOnlyTensorSpan<T> x, T y)
4951
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
4988
public static
Tensor
<T> MinMagnitudeNumber<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
4991
TensorOperation.ValidateCompatibility(in x, in y, out
Tensor
<T> destination);
5011
public static
Tensor
<T> MinMagnitudeNumber<T>(in ReadOnlyTensorSpan<T> x, T y)
5014
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
5051
public static
Tensor
<T> MinNumber<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
5054
TensorOperation.ValidateCompatibility(in x, in y, out
Tensor
<T> destination);
5074
public static
Tensor
<T> MinNumber<T>(in ReadOnlyTensorSpan<T> x, T y)
5077
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
5112
public static
Tensor
<T> PopCount<T>(in ReadOnlyTensorSpan<T> x)
5115
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
5136
public static
Tensor
<T> Pow<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
5139
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<T> destination);
5159
public static
Tensor
<T> Pow<T>(in ReadOnlyTensorSpan<T> x, T y)
5162
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
5182
public static
Tensor
<T> Pow<T>(T x, in ReadOnlyTensorSpan<T> y)
5185
Tensor
<T> destination = CreateFromShapeUninitialized<T>(y.Lengths);
5218
public static
Tensor
<T> RadiansToDegrees<T>(in ReadOnlyTensorSpan<T> x)
5221
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
5241
public static
Tensor
<T> Reciprocal<T>(in ReadOnlyTensorSpan<T> x)
5244
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
5265
public static
Tensor
<T> RootN<T>(in ReadOnlyTensorSpan<T> x, int n)
5268
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
5291
public static
Tensor
<T> RotateLeft<T>(in ReadOnlyTensorSpan<T> x, int rotateAmount)
5294
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
5318
public static
Tensor
<T> RotateRight<T>(in ReadOnlyTensorSpan<T> x, int rotateAmount)
5321
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
5343
public static
Tensor
<T> Round<T>(in ReadOnlyTensorSpan<T> x)
5346
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
5366
public static
Tensor
<T> Round<T>(in ReadOnlyTensorSpan<T> x, int digits, MidpointRounding mode)
5369
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
5390
public static
Tensor
<T> Round<T>(in ReadOnlyTensorSpan<T> x, int digits)
5393
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
5413
public static
Tensor
<T> Round<T>(in ReadOnlyTensorSpan<T> x, MidpointRounding mode)
5416
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
5437
public static
Tensor
<T> Sigmoid<T>(in ReadOnlyTensorSpan<T> x)
5440
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
5459
/// Takes the sin of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
5462
public static
Tensor
<T> Sin<T>(in ReadOnlyTensorSpan<T> x)
5465
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
5487
public static
Tensor
<T> Sinh<T>(in ReadOnlyTensorSpan<T> x)
5490
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
5510
public static
Tensor
<T> SinPi<T>(in ReadOnlyTensorSpan<T> x)
5513
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
5533
public static
Tensor
<T> SoftMax<T>(in ReadOnlyTensorSpan<T> x)
5539
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
5560
/// Takes the square root of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
5563
public static
Tensor
<T> Sqrt<T>(in ReadOnlyTensorSpan<T> x)
5566
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
5635
public static
Tensor
<T> Tan<T>(in ReadOnlyTensorSpan<T> x)
5638
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
5658
public static
Tensor
<T> Tanh<T>(in ReadOnlyTensorSpan<T> x)
5661
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
5681
public static
Tensor
<T> TanPi<T>(in ReadOnlyTensorSpan<T> x)
5684
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
5704
public static
Tensor
<T> TrailingZeroCount<T>(in ReadOnlyTensorSpan<T> x)
5707
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
5727
public static
Tensor
<T> Truncate<T>(in ReadOnlyTensorSpan<T> x)
5730
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
System\Numerics\Tensors\netcore\Tensor.op_Addition.cs (18)
14
public static
Tensor
<T> Add<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
17
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<T> destination);
27
public static
Tensor
<T> Add<T>(in ReadOnlyTensorSpan<T> x, T y)
30
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
74
public static
Tensor
<TScalar> operator +(in ReadOnlyTensorSpan<TScalar> left, in ReadOnlyTensorSpan<TScalar> right) => Add(left, right);
80
public static
Tensor
<TScalar> operator +(in ReadOnlyTensorSpan<TScalar> left, TScalar right) => Add(left, right);
86
public static
Tensor
<TScalar> operator +(TScalar left, in ReadOnlyTensorSpan<TScalar> right) => Add(right, left);
90
extension<TScalar>(
Tensor
<TScalar> tensor)
94
public static
Tensor
<TScalar> operator +(
Tensor
<TScalar> left,
Tensor
<TScalar> right) => Add<TScalar>(left, right);
97
public static
Tensor
<TScalar> operator +(
Tensor
<TScalar> left, TScalar right) => Add(left, right);
100
public static
Tensor
<TScalar> operator +(TScalar left,
Tensor
<TScalar> right) => Add(right, left);
115
public static
Tensor
<TScalar> operator +(in TensorSpan<TScalar> left, in TensorSpan<TScalar> right) => Add<TScalar>(left, right);
118
public static
Tensor
<TScalar> operator +(in TensorSpan<TScalar> left, TScalar right) => Add(left, right);
121
public static
Tensor
<TScalar> operator +(TScalar left, in TensorSpan<TScalar> right) => Add(right, left);
System\Numerics\Tensors\netcore\Tensor.op_BitwiseAnd.cs (18)
14
public static
Tensor
<T> BitwiseAnd<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
17
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<T> destination);
27
public static
Tensor
<T> BitwiseAnd<T>(in ReadOnlyTensorSpan<T> x, T y)
30
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
74
public static
Tensor
<TScalar> operator &(in ReadOnlyTensorSpan<TScalar> left, in ReadOnlyTensorSpan<TScalar> right) => BitwiseAnd(left, right);
80
public static
Tensor
<TScalar> operator &(in ReadOnlyTensorSpan<TScalar> left, TScalar right) => BitwiseAnd(left, right);
86
public static
Tensor
<TScalar> operator &(TScalar left, in ReadOnlyTensorSpan<TScalar> right) => BitwiseAnd(right, left);
90
extension<TScalar>(
Tensor
<TScalar> tensor)
94
public static
Tensor
<TScalar> operator &(
Tensor
<TScalar> left,
Tensor
<TScalar> right) => BitwiseAnd<TScalar>(left, right);
97
public static
Tensor
<TScalar> operator &(
Tensor
<TScalar> left, TScalar right) => BitwiseAnd(left, right);
100
public static
Tensor
<TScalar> operator &(TScalar left,
Tensor
<TScalar> right) => BitwiseAnd(right, left);
115
public static
Tensor
<TScalar> operator &(in TensorSpan<TScalar> left, in TensorSpan<TScalar> right) => BitwiseAnd<TScalar>(left, right);
118
public static
Tensor
<TScalar> operator &(in TensorSpan<TScalar> left, TScalar right) => BitwiseAnd(left, right);
121
public static
Tensor
<TScalar> operator &(TScalar left, in TensorSpan<TScalar> right) => BitwiseAnd(right, left);
System\Numerics\Tensors\netcore\Tensor.op_BitwiseOr.cs (18)
14
public static
Tensor
<T> BitwiseOr<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
17
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<T> destination);
27
public static
Tensor
<T> BitwiseOr<T>(in ReadOnlyTensorSpan<T> x, T y)
30
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
74
public static
Tensor
<TScalar> operator |(in ReadOnlyTensorSpan<TScalar> left, in ReadOnlyTensorSpan<TScalar> right) => BitwiseOr(left, right);
80
public static
Tensor
<TScalar> operator |(in ReadOnlyTensorSpan<TScalar> left, TScalar right) => BitwiseOr(left, right);
86
public static
Tensor
<TScalar> operator |(TScalar left, in ReadOnlyTensorSpan<TScalar> right) => BitwiseOr(right, left);
90
extension<TScalar>(
Tensor
<TScalar> tensor)
94
public static
Tensor
<TScalar> operator |(
Tensor
<TScalar> left,
Tensor
<TScalar> right) => BitwiseOr<TScalar>(left, right);
97
public static
Tensor
<TScalar> operator |(
Tensor
<TScalar> left, TScalar right) => BitwiseOr(left, right);
100
public static
Tensor
<TScalar> operator |(TScalar left,
Tensor
<TScalar> right) => BitwiseOr(right, left);
115
public static
Tensor
<TScalar> operator |(in TensorSpan<TScalar> left, in TensorSpan<TScalar> right) => BitwiseOr<TScalar>(left, right);
118
public static
Tensor
<TScalar> operator |(in TensorSpan<TScalar> left, TScalar right) => BitwiseOr(left, right);
121
public static
Tensor
<TScalar> operator |(TScalar left, in TensorSpan<TScalar> right) => BitwiseOr(right, left);
System\Numerics\Tensors\netcore\Tensor.op_Decrement.cs (3)
12
public static
Tensor
<T> Decrement<T>(in ReadOnlyTensorSpan<T> x)
15
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
36
extension<TScalar>(
Tensor
<TScalar> tensor)
System\Numerics\Tensors\netcore\Tensor.op_Division.cs (20)
14
public static
Tensor
<T> Divide<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
17
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<T> destination);
27
public static
Tensor
<T> Divide<T>(in ReadOnlyTensorSpan<T> x, T y)
30
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
40
public static
Tensor
<T> Divide<T>(T x, in ReadOnlyTensorSpan<T> y)
43
Tensor
<T> destination = CreateFromShapeUninitialized<T>(y.Lengths);
101
public static
Tensor
<TScalar> operator /(in ReadOnlyTensorSpan<TScalar> left, in ReadOnlyTensorSpan<TScalar> right) => Divide(left, right);
107
public static
Tensor
<TScalar> operator /(in ReadOnlyTensorSpan<TScalar> left, TScalar right) => Divide(left, right);
113
public static
Tensor
<TScalar> operator /(TScalar left, in ReadOnlyTensorSpan<TScalar> right) => Divide(left, right);
117
extension<TScalar>(
Tensor
<TScalar> tensor)
121
public static
Tensor
<TScalar> operator /(
Tensor
<TScalar> left,
Tensor
<TScalar> right) => Divide<TScalar>(left, right);
124
public static
Tensor
<TScalar> operator /(
Tensor
<TScalar> left, TScalar right) => Divide(left, right);
127
public static
Tensor
<TScalar> operator /(TScalar left,
Tensor
<TScalar> right) => Divide(left, right);
142
public static
Tensor
<TScalar> operator /(in TensorSpan<TScalar> left, in TensorSpan<TScalar> right) => Divide<TScalar>(left, right);
145
public static
Tensor
<TScalar> operator /(in TensorSpan<TScalar> left, TScalar right) => Divide(left, right);
148
public static
Tensor
<TScalar> operator /(TScalar left, in TensorSpan<TScalar> right) => Divide(left, right);
System\Numerics\Tensors\netcore\Tensor.op_ExclusiveOr.cs (18)
14
public static
Tensor
<T> Xor<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
17
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<T> destination);
27
public static
Tensor
<T> Xor<T>(in ReadOnlyTensorSpan<T> x, T y)
30
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
74
public static
Tensor
<TScalar> operator ^(in ReadOnlyTensorSpan<TScalar> left, in ReadOnlyTensorSpan<TScalar> right) => Xor(left, right);
80
public static
Tensor
<TScalar> operator ^(in ReadOnlyTensorSpan<TScalar> left, TScalar right) => Xor(left, right);
86
public static
Tensor
<TScalar> operator ^(TScalar left, in ReadOnlyTensorSpan<TScalar> right) => Xor(right, left);
90
extension<TScalar>(
Tensor
<TScalar> tensor)
94
public static
Tensor
<TScalar> operator ^(
Tensor
<TScalar> left,
Tensor
<TScalar> right) => Xor<TScalar>(left, right);
97
public static
Tensor
<TScalar> operator ^(
Tensor
<TScalar> left, TScalar right) => Xor(left, right);
100
public static
Tensor
<TScalar> operator ^(TScalar left,
Tensor
<TScalar> right) => Xor(right, left);
115
public static
Tensor
<TScalar> operator ^(in TensorSpan<TScalar> left, in TensorSpan<TScalar> right) => Xor<TScalar>(left, right);
118
public static
Tensor
<TScalar> operator ^(in TensorSpan<TScalar> left, TScalar right) => Xor(left, right);
121
public static
Tensor
<TScalar> operator ^(TScalar left, in TensorSpan<TScalar> right) => Xor(right, left);
System\Numerics\Tensors\netcore\Tensor.op_Increment.cs (3)
12
public static
Tensor
<T> Increment<T>(in ReadOnlyTensorSpan<T> x)
15
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
36
extension<TScalar>(
Tensor
<TScalar> tensor)
System\Numerics\Tensors\netcore\Tensor.op_LeftShift.cs (8)
13
public static
Tensor
<T> ShiftLeft<T>(in ReadOnlyTensorSpan<T> x, int shiftAmount)
16
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
44
public static
Tensor
<TScalar> operator <<(in ReadOnlyTensorSpan<TScalar> tensor, int shiftAmount) => ShiftLeft(tensor, shiftAmount);
48
extension<TScalar>(
Tensor
<TScalar>)
52
public static
Tensor
<TScalar> operator <<(
Tensor
<TScalar> tensor, int shiftAmount) => ShiftLeft<TScalar>(tensor, shiftAmount);
57
extension<TScalar>(
Tensor
<TScalar> tensor)
69
public static
Tensor
<TScalar> operator <<(in TensorSpan<TScalar> tensor, int shiftAmount) => ShiftLeft<TScalar>(tensor, shiftAmount);
System\Numerics\Tensors\netcore\Tensor.op_Multiply.cs (18)
14
public static
Tensor
<T> Multiply<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
17
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<T> destination);
27
public static
Tensor
<T> Multiply<T>(in ReadOnlyTensorSpan<T> x, T y)
30
Tensor
<T> destination = CreateFromShape<T>(x.Lengths);
74
public static
Tensor
<TScalar> operator *(in ReadOnlyTensorSpan<TScalar> left, in ReadOnlyTensorSpan<TScalar> right) => Multiply(left, right);
80
public static
Tensor
<TScalar> operator *(in ReadOnlyTensorSpan<TScalar> left, TScalar right) => Multiply(left, right);
86
public static
Tensor
<TScalar> operator *(TScalar left, in ReadOnlyTensorSpan<TScalar> right) => Multiply(right, left);
90
extension<TScalar>(
Tensor
<TScalar> tensor)
94
public static
Tensor
<TScalar> operator *(
Tensor
<TScalar> left,
Tensor
<TScalar> right) => Multiply<TScalar>(left, right);
97
public static
Tensor
<TScalar> operator *(
Tensor
<TScalar> left, TScalar right) => Multiply(left, right);
100
public static
Tensor
<TScalar> operator *(TScalar left,
Tensor
<TScalar> right) => Multiply(right, left);
115
public static
Tensor
<TScalar> operator *(in TensorSpan<TScalar> left, in TensorSpan<TScalar> right) => Multiply<TScalar>(left, right);
118
public static
Tensor
<TScalar> operator *(in TensorSpan<TScalar> left, TScalar right) => Multiply(left, right);
121
public static
Tensor
<TScalar> operator *(TScalar left, in TensorSpan<TScalar> right) => Multiply(right, left);
System\Numerics\Tensors\netcore\Tensor.op_OnesComplement.cs (7)
12
public static
Tensor
<T> OnesComplement<T>(in ReadOnlyTensorSpan<T> x)
15
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
41
public static
Tensor
<TScalar> operator ~(in ReadOnlyTensorSpan<TScalar> tensor) => OnesComplement(tensor);
45
extension<TScalar>(
Tensor
<TScalar>)
49
public static
Tensor
<TScalar> operator ~(
Tensor
<TScalar> tensor) => OnesComplement<TScalar>(tensor);
57
public static
Tensor
<TScalar> operator ~(in TensorSpan<TScalar> tensor) => OnesComplement<TScalar>(tensor);
System\Numerics\Tensors\netcore\Tensor.op_RightShift.cs (8)
13
public static
Tensor
<T> ShiftRightArithmetic<T>(in ReadOnlyTensorSpan<T> x, int shiftAmount)
16
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
44
public static
Tensor
<TScalar> operator >>(in ReadOnlyTensorSpan<TScalar> tensor, int shiftAmount) => ShiftRightArithmetic(tensor, shiftAmount);
48
extension<TScalar>(
Tensor
<TScalar>)
52
public static
Tensor
<TScalar> operator >>(
Tensor
<TScalar> tensor, int shiftAmount) => ShiftRightArithmetic<TScalar>(tensor, shiftAmount);
57
extension<TScalar>(
Tensor
<TScalar> tensor)
69
public static
Tensor
<TScalar> operator >>(in TensorSpan<TScalar> tensor, int shiftAmount) => ShiftRightArithmetic<TScalar>(tensor, shiftAmount);
System\Numerics\Tensors\netcore\Tensor.op_Subtraction.cs (20)
14
public static
Tensor
<T> Subtract<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
17
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<T> destination);
27
public static
Tensor
<T> Subtract<T>(in ReadOnlyTensorSpan<T> x, T y)
30
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
40
public static
Tensor
<T> Subtract<T>(T x, in ReadOnlyTensorSpan<T> y)
43
Tensor
<T> destination = CreateFromShapeUninitialized<T>(y.Lengths);
102
public static
Tensor
<TScalar> operator -(in ReadOnlyTensorSpan<TScalar> left, in ReadOnlyTensorSpan<TScalar> right) => Subtract(left, right);
108
public static
Tensor
<TScalar> operator -(in ReadOnlyTensorSpan<TScalar> left, TScalar right) => Subtract(left, right);
114
public static
Tensor
<TScalar> operator -(TScalar left, in ReadOnlyTensorSpan<TScalar> right) => Subtract(left, right);
118
extension<TScalar>(
Tensor
<TScalar> tensor)
122
public static
Tensor
<TScalar> operator -(
Tensor
<TScalar> left,
Tensor
<TScalar> right) => Subtract<TScalar>(left, right);
125
public static
Tensor
<TScalar> operator -(
Tensor
<TScalar> left, TScalar right) => Subtract(left, right);
128
public static
Tensor
<TScalar> operator -(TScalar left,
Tensor
<TScalar> right) => Subtract(left, right);
143
public static
Tensor
<TScalar> operator -(in TensorSpan<TScalar> left, in TensorSpan<TScalar> right) => Subtract<TScalar>(left, right);
146
public static
Tensor
<TScalar> operator -(in TensorSpan<TScalar> left, TScalar right) => Subtract(left, right);
149
public static
Tensor
<TScalar> operator -(TScalar left, in TensorSpan<TScalar> right) => Subtract(left, right);
System\Numerics\Tensors\netcore\Tensor.op_UnaryNegation.cs (7)
11
public static
Tensor
<T> Negate<T>(in ReadOnlyTensorSpan<T> x)
14
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
39
public static
Tensor
<TScalar> operator -(in ReadOnlyTensorSpan<TScalar> tensor) => Negate(tensor);
43
extension<TScalar>(
Tensor
<TScalar>)
47
public static
Tensor
<TScalar> operator -(
Tensor
<TScalar> tensor) => Negate<TScalar>(tensor);
55
public static
Tensor
<TScalar> operator -(in TensorSpan<TScalar> tensor) => Negate<TScalar>(tensor);
System\Numerics\Tensors\netcore\Tensor.op_UnaryPlus.cs (3)
19
extension<TScalar>(
Tensor
<TScalar>)
23
public static
Tensor
<TScalar> operator +(
Tensor
<TScalar> tensor) => tensor;
System\Numerics\Tensors\netcore\Tensor.op_UnsignedRightShift.cs (8)
13
public static
Tensor
<T> ShiftRightLogical<T>(in ReadOnlyTensorSpan<T> x, int shiftAmount)
16
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
44
public static
Tensor
<TScalar> operator >>>(in ReadOnlyTensorSpan<TScalar> tensor, int shiftAmount) => ShiftRightLogical(tensor, shiftAmount);
48
extension<TScalar>(
Tensor
<TScalar>)
52
public static
Tensor
<TScalar> operator >>>(
Tensor
<TScalar> tensor, int shiftAmount) => ShiftRightLogical<TScalar>(tensor, shiftAmount);
57
extension<TScalar>(
Tensor
<TScalar> tensor)
69
public static
Tensor
<TScalar> operator >>>(in TensorSpan<TScalar> tensor, int shiftAmount) => ShiftRightLogical<TScalar>(tensor, shiftAmount);
System\Numerics\Tensors\netcore\TensorOperation.cs (1)
1490
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>