20 instantiations of Tensor
System.Numerics.Tensors (20)
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 (16)
409
=> new
Tensor
<T>(array);
414
=> new
Tensor
<T>(array, lengths, strides: []);
419
=> new
Tensor
<T>(array, lengths, strides);
424
=> new
Tensor
<T>(array, start, lengths, strides);
431
=> new
Tensor
<T>(lengths, strides: [], pinned);
436
=> new
Tensor
<T>(lengths, strides, pinned);
447
return new
Tensor
<T>(values, in shape);
1504
Tensor<T> result = new
Tensor
<T>(tensor._values, tensor._start, newLengths, newStrides, tensor.IsPinned);
1623
return new
Tensor
<T>(tensor._values, tensor._start, reshaped._shape);
1636
Tensor<T> result = new
Tensor
<T>(tensor._values, tensor._start, newLengths, strides, tensor.IsPinned);
2161
outputs[i] = new
Tensor
<T>(values, newLengths, strides: []);
2245
Tensor<T> output = new
Tensor
<T>(tensor._values, tensor._start, lengths[..rank], strides[..rank], tensor.IsPinned);
2496
tensor = new
Tensor
<T>(tensor._values, tensor._start, TensorShape.WithRank(tensor._shape, rank));
2681
Tensor<T> output = new
Tensor
<T>(tensor._values, tensor._start, lengths, strides, tensor.IsPinned);
2742
return new
Tensor
<T>(tensor._values, tensor._start, unsqueezed._shape);
2776
Tensor<T> output = new
Tensor
<T>(tensor._values, tensor._start, newLengths, newStrides, tensor.IsPinned);
609 references to Tensor
System.Numerics.Tensors (609)
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 (402)
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,
303
foreach (
Tensor
<T> tensor in tensors)
305
Tensor
<T>.Enumerator input = tensor.GetEnumerator();
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 void ConcatenateOnDimensionToSpan<T>(int dimension, scoped ReadOnlySpan<
Tensor
<T>> tensors, in TensorSpan<T> destination, Span<T> dstSpan)
408
public static
Tensor
<T> Create<T>(T[] array)
413
public static
Tensor
<T> Create<T>(T[] array, scoped ReadOnlySpan<nint> lengths)
418
public static
Tensor
<T> Create<T>(T[] array, scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides)
423
public static
Tensor
<T> Create<T>(T[] array, int start, scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides)
430
public static
Tensor
<T> CreateFromShape<T>(scoped ReadOnlySpan<nint> lengths, bool pinned = false)
435
public static
Tensor
<T> CreateFromShape<T>(scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides, bool pinned = false)
439
public static
Tensor
<T> CreateFromShapeUninitialized<T>(scoped ReadOnlySpan<nint> lengths, bool pinned = false)
443
public static
Tensor
<T> CreateFromShapeUninitialized<T>(scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides, bool pinned = false)
574
public static
Tensor
<bool> Equals<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
577
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<bool> destination);
605
public static
Tensor
<bool> Equals<T>(in ReadOnlyTensorSpan<T> x, T y)
608
Tensor
<bool> destination = CreateFromShapeUninitialized<bool>(x.Lengths);
694
/// <param name="tensor">Input <see cref="
Tensor
{T}"/>.</param>
708
/// <param name="tensor">Input <see cref="
Tensor
{T}"/>.</param>
723
/// 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"/>
728
/// <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
730
public static
Tensor
<bool> GreaterThan<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
733
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<bool> destination);
741
/// 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"/>
747
/// <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
759
/// 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"/>
764
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/>
766
public static
Tensor
<bool> GreaterThan<T>(in ReadOnlyTensorSpan<T> x, T y)
769
Tensor
<bool> destination = CreateFromShape<bool>(x.Lengths, false);
776
/// 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"/>
782
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/>
794
/// 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"/>
799
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/>
801
public static
Tensor
<bool> GreaterThan<T>(T x, in ReadOnlyTensorSpan<T> y)
806
/// 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"/>
812
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/>
904
/// 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"/>
909
/// <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
911
public static
Tensor
<bool> GreaterThanOrEqual<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
914
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<bool> destination);
922
/// 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"/>
928
/// <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
940
/// 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"/>
945
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/>
947
public static
Tensor
<bool> GreaterThanOrEqual<T>(in ReadOnlyTensorSpan<T> x, T y)
950
Tensor
<bool> destination = CreateFromShape<bool>(x.Lengths, false);
957
/// 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"/>
963
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/>
975
/// 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"/>
980
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/>
982
public static
Tensor
<bool> GreaterThanOrEqual<T>(T x, in ReadOnlyTensorSpan<T> y)
987
/// 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"/>
993
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/>
1085
/// 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"/>
1090
/// <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
1092
public static
Tensor
<bool> LessThan<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
1095
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<bool> destination);
1103
/// 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"/>
1109
/// <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
1120
/// Compares the elements of a <see cref="
Tensor
{T}"/> to see which elements are less than <paramref name="y"/>.
1121
/// 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"/>
1124
/// <param name="x"><see cref="
Tensor
{T}"/> to compare.</param>
1126
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/>
1128
public static
Tensor
<bool> LessThan<T>(in ReadOnlyTensorSpan<T> x, T y)
1131
Tensor
<bool> destination = CreateFromShape<bool>(x.Lengths, false);
1137
/// Compares the elements of a <see cref="
Tensor
{T}"/> to see which elements are less than <paramref name="y"/>.
1138
/// 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"/>
1141
/// <param name="x"><see cref="
Tensor
{T}"/> to compare.</param>
1144
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/>
1155
/// Compares the elements of a <see cref="
Tensor
{T}"/> to see which elements are less than <paramref name="y"/>.
1156
/// 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"/>
1159
/// <param name="x"><see cref="
Tensor
{T}"/> to compare.</param>
1161
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/>
1163
public static
Tensor
<bool> LessThan<T>(T x, in ReadOnlyTensorSpan<T> y)
1167
/// Compares the elements of a <see cref="
Tensor
{T}"/> to see which elements are less than <paramref name="y"/>.
1168
/// 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
/// <param name="x"><see cref="
Tensor
{T}"/> to compare.</param>
1174
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/>
1266
/// 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"/>
1271
/// <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
1273
public static
Tensor
<bool> LessThanOrEqual<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
1276
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<bool> destination);
1284
/// 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"/>
1290
/// <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
1301
/// Compares the elements of a <see cref="
Tensor
{T}"/> to see which elements are less than <paramref name="y"/>.
1302
/// 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"/>
1305
/// <param name="x"><see cref="
Tensor
{T}"/> to compare.</param>
1307
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/>
1309
public static
Tensor
<bool> LessThanOrEqual<T>(in ReadOnlyTensorSpan<T> x, T y)
1312
Tensor
<bool> destination = CreateFromShape<bool>(x.Lengths, false);
1318
/// Compares the elements of a <see cref="
Tensor
{T}"/> to see which elements are less than <paramref name="y"/>.
1319
/// 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"/>
1322
/// <param name="x"><see cref="
Tensor
{T}"/> to compare.</param>
1325
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/>
1336
/// Compares the elements of a <see cref="
Tensor
{T}"/> to see which elements are less than <paramref name="y"/>.
1337
/// 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"/>
1340
/// <param name="x"><see cref="
Tensor
{T}"/> to compare.</param>
1342
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/>
1344
public static
Tensor
<bool> LessThanOrEqual<T>(T x, in ReadOnlyTensorSpan<T> y)
1348
/// Compares the elements of a <see cref="
Tensor
{T}"/> to see which elements are less than <paramref name="y"/>.
1349
/// 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
/// <param name="x"><see cref="
Tensor
{T}"/> to compare.</param>
1355
/// <returns><see cref="
Tensor
{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/>
1447
/// If <paramref name="tensor"/> is a 1D tensor, it will return <paramref name="tensor"/>. Otherwise it creates a new <see cref="
Tensor
{T}"/>
1450
/// <param name="tensor">Input <see cref="
Tensor
{T}"/></param>
1452
public static
Tensor
<T> PermuteDimensions<T>(this
Tensor
<T> tensor, ReadOnlySpan<int> dimensions)
1504
Tensor
<T> result = new Tensor<T>(tensor._values, tensor._start, newLengths, newStrides, tensor.IsPinned);
1611
/// <param name="tensor"><see cref="
Tensor
{T}"/> you want to reshape.</param>
1613
public static
Tensor
<T> Reshape<T>(this
Tensor
<T> tensor, ReadOnlySpan<nint> lengths)
1636
Tensor
<T> result = new Tensor<T>(tensor._values, tensor._start, newLengths, strides, tensor.IsPinned);
1710
/// 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
1713
/// <param name="tensor">Input <see cref="
Tensor
{T}"/>.</param>
1715
public static
Tensor
<T> Resize<T>(
Tensor
<T> tensor, ReadOnlySpan<nint> lengths)
1717
Tensor
<T> output = CreateFromShape<T>(lengths, tensor.IsPinned);
1772
/// <param name="tensor">Input <see cref="
Tensor
{T}"/>.</param>
1774
public static void ResizeTo<T>(scoped in
Tensor
<T> tensor, in TensorSpan<T> destination)
1857
/// <param name="tensor">Input <see cref="
Tensor
{T}"/>.</param>
1858
public static
Tensor
<T> Reverse<T>(in ReadOnlyTensorSpan<T> tensor)
1860
Tensor
<T> output = CreateFromShape<T>(tensor.Lengths);
1870
/// <param name="tensor">Input <see cref="
Tensor
{T}"/>.</param>
1872
public static
Tensor
<T> ReverseDimension<T>(in ReadOnlyTensorSpan<T> tensor, int dimension)
1874
Tensor
<T> output = CreateFromShape<T>(tensor.Lengths);
2088
/// <param name="tensor">Input <see cref="
Tensor
{T}"/>.</param>
2091
public static
Tensor
<T> SetSlice<T>(this
Tensor
<T> tensor, in ReadOnlyTensorSpan<T> values, params ReadOnlySpan<NRange> ranges)
2100
/// <param name="tensor">Input <see cref="
Tensor
{T}"/>.</param>
2119
/// Split a <see cref="
Tensor
{T}"/> into <paramref name="splitCount"/> along the given <paramref name="dimension"/>. If the tensor cannot be split
2122
/// <param name="tensor">Input <see cref="
Tensor
{T}"/>.</param>
2127
public static
Tensor
<T>[] Split<T>(scoped in ReadOnlyTensorSpan<T> tensor, int splitCount, nint dimension)
2142
Tensor
<T>[] outputs = new
Tensor
<T>[splitCount];
2177
/// <param name="tensor">The <see cref="
Tensor
{T}"/> to remove all dimensions of length 1.</param>
2178
public static
Tensor
<T> Squeeze<T>(this
Tensor
<T> tensor)
2187
/// <param name="tensor">The <see cref="
Tensor
{T}"/> to remove dimension of length 1.</param>
2189
public static
Tensor
<T> SqueezeDimension<T>(this
Tensor
<T> tensor, int dimension)
2245
Tensor
<T> output = new Tensor<T>(tensor._values, tensor._start, lengths[..rank], strides[..rank], tensor.IsPinned);
2414
/// Join multiple <see cref="
Tensor
{T}"/> along a new dimension that is added at position 0. All tensors must have equivalent shapes.
2416
/// <param name="tensors">Input <see cref="
Tensor
{T}"/>.</param>
2418
public static
Tensor
<T> Stack<T>(params ReadOnlySpan<
Tensor
<T>> tensors)
2424
/// 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.
2426
/// <param name="tensors">Input <see cref="
Tensor
{T}"/>.</param>
2429
public static
Tensor
<T> StackAlongDimension<T>(int dimension, params ReadOnlySpan<
Tensor
<T>> tensors)
2431
Tensor
<T>[] outputs = UnsqueezeForStack(dimension, tensors);
2433
Tensor
<T> result = CreateConcatenationResult<T>(lengths, dimension, outputs.Length);
2439
/// Join multiple <see cref="
Tensor
{T}"/> along a new dimension that is added at position 0. All tensors must have equivalent shapes.
2441
/// <param name="tensors">Input <see cref="
Tensor
{T}"/>.</param>
2444
public static ref readonly TensorSpan<T> Stack<T>(scoped in ReadOnlySpan<
Tensor
<T>> tensors, in TensorSpan<T> destination)
2450
/// 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.
2452
/// <param name="tensors">Input <see cref="
Tensor
{T}"/>.</param>
2456
public static ref readonly TensorSpan<T> StackAlongDimension<T>(scoped ReadOnlySpan<
Tensor
<T>> tensors, in TensorSpan<T> destination, int dimension)
2458
Tensor
<T>[] outputs = UnsqueezeForStack(dimension, tensors);
2466
private static
Tensor
<T>[] UnsqueezeForStack<T>(int dimension, scoped ReadOnlySpan<
Tensor
<T>> tensors)
2490
Tensor
<T>[] outputs = new
Tensor
<T>[tensors.Length];
2493
Tensor
<T> tensor = tensors[i];
2661
/// <param name="tensor">Input <see cref="
Tensor
{T}"/>.</param>
2662
public static
Tensor
<T> Transpose<T>(
Tensor
<T> tensor)
2681
Tensor
<T> output = new Tensor<T>(tensor._values, tensor._start, lengths, strides, tensor.IsPinned);
2695
/// <param name="tensor">Input <see cref="
Tensor
{T}"/>.</param>
2697
public static bool TryBroadcastTo<T>(this
Tensor
<T> tensor, in TensorSpan<T> destination)
2735
/// <param name="tensor">The <see cref="
Tensor
{T}"/> to add a dimension of length 1.</param>
2737
public static
Tensor
<T> Unsqueeze<T>(this
Tensor
<T> tensor, int dimension)
2776
Tensor
<T> output = new Tensor<T>(tensor._values, tensor._start, newLengths, newStrides, tensor.IsPinned);
2876
/// Takes the absolute value of each element of the <see cref="
Tensor
{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
2879
public static
Tensor
<T> Abs<T>(in ReadOnlyTensorSpan<T> x)
2882
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
2903
/// Takes the inverse cosine of each element of the <see cref="
Tensor
{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
2906
public static
Tensor
<T> Acos<T>(in ReadOnlyTensorSpan<T> x)
2909
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
2915
/// Takes the inverse cosine of each element of the <see cref="
Tensor
{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
2930
/// 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.
2933
public static
Tensor
<T> Acosh<T>(in ReadOnlyTensorSpan<T> x)
2936
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
2957
/// 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.
2960
public static
Tensor
<T> AcosPi<T>(in ReadOnlyTensorSpan<T> x)
2963
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
2984
/// Takes the inverse sin of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
2987
public static
Tensor
<T> Asin<T>(in ReadOnlyTensorSpan<T> x)
2990
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
3011
/// 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.
3014
public static
Tensor
<T> Asinh<T>(in ReadOnlyTensorSpan<T> x)
3017
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
3038
/// 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.
3041
public static
Tensor
<T> AsinPi<T>(in ReadOnlyTensorSpan<T> x)
3044
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
3065
/// Takes the arc tangent of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
3068
public static
Tensor
<T> Atan<T>(in ReadOnlyTensorSpan<T> x)
3071
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
3092
/// Takes the arc tangent of the two input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
3096
public static
Tensor
<T> Atan2<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
3099
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<T> destination);
3119
/// Takes the arc tangent of the two input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
3123
public static
Tensor
<T> Atan2<T>(in ReadOnlyTensorSpan<T> x, T y)
3126
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
3146
/// Takes the arc tangent of the two input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
3150
public static
Tensor
<T> Atan2<T>(T x, in ReadOnlyTensorSpan<T> y)
3153
Tensor
<T> destination = CreateFromShapeUninitialized<T>(y.Lengths);
3175
/// 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.
3179
public static
Tensor
<T> Atan2Pi<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
3182
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<T> destination);
3206
public static
Tensor
<T> Atan2Pi<T>(in ReadOnlyTensorSpan<T> x, T y)
3209
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
3233
public static
Tensor
<T> Atan2Pi<T>(T x, in ReadOnlyTensorSpan<T> y)
3236
Tensor
<T> destination = CreateFromShapeUninitialized<T>(y.Lengths);
3258
/// 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.
3261
public static
Tensor
<T> Atanh<T>(in ReadOnlyTensorSpan<T> x)
3264
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
3285
/// 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.
3288
public static
Tensor
<T> AtanPi<T>(in ReadOnlyTensorSpan<T> x)
3291
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
3329
/// Computes the element-wise cube root of the input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
3332
public static
Tensor
<T> Cbrt<T>(in ReadOnlyTensorSpan<T> x)
3335
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
3356
/// Computes the element-wise ceiling of the input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
3359
public static
Tensor
<T> Ceiling<T>(in ReadOnlyTensorSpan<T> x)
3362
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
3387
public static
Tensor
<TTo> ConvertChecked<TFrom, TTo>(in ReadOnlyTensorSpan<TFrom> source)
3391
Tensor
<TTo> destination = CreateFromShapeUninitialized<TTo>(source.Lengths);
3418
public static
Tensor
<TTo> ConvertSaturating<TFrom, TTo>(in ReadOnlyTensorSpan<TFrom> source)
3422
Tensor
<TTo> destination = CreateFromShapeUninitialized<TTo>(source.Lengths);
3449
public static
Tensor
<TTo> ConvertTruncating<TFrom, TTo>(in ReadOnlyTensorSpan<TFrom> source)
3453
Tensor
<TTo> destination = CreateFromShapeUninitialized<TTo>(source.Lengths);
3480
public static
Tensor
<T> CopySign<T>(in ReadOnlyTensorSpan<T> x, T sign)
3483
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
3489
/// 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.
3493
public static
Tensor
<T> CopySign<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> sign)
3496
TensorOperation.ValidateCompatibility(x, sign, out
Tensor
<T> destination);
3532
/// Takes the cosine of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
3535
public static
Tensor
<T> Cos<T>(in ReadOnlyTensorSpan<T> x)
3538
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
3559
/// Takes the hyperbolic cosine of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
3562
public static
Tensor
<T> Cosh<T>(in ReadOnlyTensorSpan<T> x)
3565
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
3601
/// <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>
3615
public static
Tensor
<T> CosPi<T>(in ReadOnlyTensorSpan<T> x)
3618
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
3652
public static
Tensor
<T> DegreesToRadians<T>(in ReadOnlyTensorSpan<T> x)
3655
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
3711
public static
Tensor
<T> Exp<T>(in ReadOnlyTensorSpan<T> x)
3714
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
3738
public static
Tensor
<T> Exp10<T>(in ReadOnlyTensorSpan<T> x)
3741
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
3763
public static
Tensor
<T> Exp10M1<T>(in ReadOnlyTensorSpan<T> x)
3766
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
3786
public static
Tensor
<T> Exp2<T>(in ReadOnlyTensorSpan<T> x)
3789
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
3809
public static
Tensor
<T> Exp2M1<T>(in ReadOnlyTensorSpan<T> x)
3812
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
3832
public static
Tensor
<T> ExpM1<T>(in ReadOnlyTensorSpan<T> x)
3835
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
3855
public static
Tensor
<T> Floor<T>(in ReadOnlyTensorSpan<T> x)
3858
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
3882
public static
Tensor
<T> Hypot<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
3885
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<T> destination);
3911
public static
Tensor
<T> Ieee754Remainder<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
3914
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<T> destination);
3935
public static
Tensor
<T> Ieee754Remainder<T>(in ReadOnlyTensorSpan<T> x, T y)
3938
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
3958
public static
Tensor
<T> Ieee754Remainder<T>(T x, in ReadOnlyTensorSpan<T> y)
3961
Tensor
<T> destination = CreateFromShapeUninitialized<T>(y.Lengths);
3982
public static
Tensor
<int> ILogB<T>(in ReadOnlyTensorSpan<T> x)
3985
Tensor
<int> destination = CreateFromShapeUninitialized<int>(x.Lengths);
4050
public static
Tensor
<T> LeadingZeroCount<T>(in ReadOnlyTensorSpan<T> x)
4053
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
4074
/// Takes the natural logarithm of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
4077
public static
Tensor
<T> Log<T>(in ReadOnlyTensorSpan<T> x)
4080
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
4101
public static
Tensor
<T> Log<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
4104
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<T> destination);
4124
public static
Tensor
<T> Log<T>(in ReadOnlyTensorSpan<T> x, T y)
4127
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
4147
/// 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.
4150
public static
Tensor
<T> Log10<T>(in ReadOnlyTensorSpan<T> x)
4153
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
4174
/// 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.
4177
public static
Tensor
<T> Log10P1<T>(in ReadOnlyTensorSpan<T> x)
4180
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
4201
/// 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.
4204
public static
Tensor
<T> Log2<T>(in ReadOnlyTensorSpan<T> x)
4207
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
4228
/// 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.
4231
public static
Tensor
<T> Log2P1<T>(in ReadOnlyTensorSpan<T> x)
4234
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
4255
/// 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.
4258
public static
Tensor
<T> LogP1<T>(in ReadOnlyTensorSpan<T> x)
4261
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
4299
public static
Tensor
<T> Max<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
4302
TensorOperation.ValidateCompatibility(in x, in y, out
Tensor
<T> output);
4322
public static
Tensor
<T> Max<T>(in ReadOnlyTensorSpan<T> x, T y)
4325
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
4362
public static
Tensor
<T> MaxMagnitude<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
4365
TensorOperation.ValidateCompatibility(in x, in y, out
Tensor
<T> destination);
4385
public static
Tensor
<T> MaxMagnitude<T>(in ReadOnlyTensorSpan<T> x, T y)
4388
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
4425
public static
Tensor
<T> MaxMagnitudeNumber<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
4428
TensorOperation.ValidateCompatibility(in x, in y, out
Tensor
<T> destination);
4448
public static
Tensor
<T> MaxMagnitudeNumber<T>(in ReadOnlyTensorSpan<T> x, T y)
4451
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
4488
public static
Tensor
<T> MaxNumber<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
4491
TensorOperation.ValidateCompatibility(in x, in y, out
Tensor
<T> destination);
4511
public static
Tensor
<T> MaxNumber<T>(in ReadOnlyTensorSpan<T> x, T y)
4514
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
4551
public static
Tensor
<T> Min<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
4554
TensorOperation.ValidateCompatibility(in x, in y, out
Tensor
<T> output);
4574
public static
Tensor
<T> Min<T>(in ReadOnlyTensorSpan<T> x, T y)
4577
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
4614
public static
Tensor
<T> MinMagnitude<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
4617
TensorOperation.ValidateCompatibility(in x, in y, out
Tensor
<T> destination);
4637
public static
Tensor
<T> MinMagnitude<T>(in ReadOnlyTensorSpan<T> x, T y)
4640
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
4677
public static
Tensor
<T> MinMagnitudeNumber<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
4680
TensorOperation.ValidateCompatibility(in x, in y, out
Tensor
<T> destination);
4700
public static
Tensor
<T> MinMagnitudeNumber<T>(in ReadOnlyTensorSpan<T> x, T y)
4703
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
4740
public static
Tensor
<T> MinNumber<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
4743
TensorOperation.ValidateCompatibility(in x, in y, out
Tensor
<T> destination);
4763
public static
Tensor
<T> MinNumber<T>(in ReadOnlyTensorSpan<T> x, T y)
4766
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
4801
public static
Tensor
<T> PopCount<T>(in ReadOnlyTensorSpan<T> x)
4804
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
4825
public static
Tensor
<T> Pow<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y)
4828
TensorOperation.ValidateCompatibility(x, y, out
Tensor
<T> destination);
4848
public static
Tensor
<T> Pow<T>(in ReadOnlyTensorSpan<T> x, T y)
4851
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
4871
public static
Tensor
<T> Pow<T>(T x, in ReadOnlyTensorSpan<T> y)
4874
Tensor
<T> destination = CreateFromShapeUninitialized<T>(y.Lengths);
4907
public static
Tensor
<T> RadiansToDegrees<T>(in ReadOnlyTensorSpan<T> x)
4910
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
4930
public static
Tensor
<T> Reciprocal<T>(in ReadOnlyTensorSpan<T> x)
4933
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
4954
public static
Tensor
<T> RootN<T>(in ReadOnlyTensorSpan<T> x, int n)
4957
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
4980
public static
Tensor
<T> RotateLeft<T>(in ReadOnlyTensorSpan<T> x, int rotateAmount)
4983
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
5007
public static
Tensor
<T> RotateRight<T>(in ReadOnlyTensorSpan<T> x, int rotateAmount)
5010
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
5032
public static
Tensor
<T> Round<T>(in ReadOnlyTensorSpan<T> x)
5035
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
5055
public static
Tensor
<T> Round<T>(in ReadOnlyTensorSpan<T> x, int digits, MidpointRounding mode)
5058
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
5079
public static
Tensor
<T> Round<T>(in ReadOnlyTensorSpan<T> x, int digits)
5082
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
5102
public static
Tensor
<T> Round<T>(in ReadOnlyTensorSpan<T> x, MidpointRounding mode)
5105
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
5126
public static
Tensor
<T> Sigmoid<T>(in ReadOnlyTensorSpan<T> x)
5129
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
5148
/// Takes the sin of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
5151
public static
Tensor
<T> Sin<T>(in ReadOnlyTensorSpan<T> x)
5154
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
5176
public static
Tensor
<T> Sinh<T>(in ReadOnlyTensorSpan<T> x)
5179
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
5199
public static
Tensor
<T> SinPi<T>(in ReadOnlyTensorSpan<T> x)
5202
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
5222
public static
Tensor
<T> SoftMax<T>(in ReadOnlyTensorSpan<T> x)
5228
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
5249
/// Takes the square root of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="
Tensor
{T}"/> with the result.
5252
public static
Tensor
<T> Sqrt<T>(in ReadOnlyTensorSpan<T> x)
5255
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
5324
public static
Tensor
<T> Tan<T>(in ReadOnlyTensorSpan<T> x)
5327
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
5347
public static
Tensor
<T> Tanh<T>(in ReadOnlyTensorSpan<T> x)
5350
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
5370
public static
Tensor
<T> TanPi<T>(in ReadOnlyTensorSpan<T> x)
5373
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
5393
public static
Tensor
<T> TrailingZeroCount<T>(in ReadOnlyTensorSpan<T> x)
5396
Tensor
<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
5416
public static
Tensor
<T> Truncate<T>(in ReadOnlyTensorSpan<T> x)
5419
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)
868
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>