19 instantiations of Tensor
System.Numerics.Tensors (19)
System\Numerics\Tensors\netcore\Tensor_1.cs (4)
21public static Tensor<T> Empty { get; } = new(); 228return new Tensor<T>( 243return new Tensor<T>( 258return 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); 520return new Tensor<T>(values, in shape); 1585Tensor<T> result = new Tensor<T>(tensor._values, tensor._start, newLengths, newStrides, tensor.IsPinned); 1704return new Tensor<T>(tensor._values, tensor._start, reshaped._shape); 1717Tensor<T> result = new Tensor<T>(tensor._values, tensor._start, newLengths, strides, tensor.IsPinned); 2438outputs[i] = new Tensor<T>(values, newLengths, strides: []); 2522Tensor<T> output = new Tensor<T>(tensor._values, tensor._start, lengths[..rank], strides[..rank], tensor.IsPinned); 2992Tensor<T> output = new Tensor<T>(tensor._values, tensor._start, lengths, strides, tensor.IsPinned); 3053return new Tensor<T>(tensor._values, tensor._start, unsqueezed._shape); 3087Tensor<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)
534Tensor<T> tmp = Tensor.CreateFromShape<T>(Lengths, IsPinned);
System\Numerics\Tensors\netcore\Tensor_1.cs (27)
18public sealed class Tensor<T> : ITensor<Tensor<T>, T>, IEnumerable<T> 21public static Tensor<T> Empty { get; } = new(); 96public Tensor<T> this[params ReadOnlySpan<NRange> ranges] 129public static implicit operator Tensor<T>(T[] array) => Tensor.Create(array); 134public static implicit operator TensorSpan<T>(Tensor<T> tensor) => tensor.AsTensorSpan(); 137public static implicit operator ReadOnlyTensorSpan<T>(Tensor<T> tensor) => tensor.AsReadOnlyTensorSpan(); 221public Tensor<T> Slice(params ReadOnlySpan<nint> startIndexes) 236public Tensor<T> Slice(params ReadOnlySpan<NIndex> startIndexes) 251public Tensor<T> Slice(params ReadOnlySpan<NRange> ranges) 266public Tensor<T> ToDenseTensor() 268Tensor<T> result = this; 327ref readonly T IReadOnlyTensor<Tensor<T>, T>.this[params ReadOnlySpan<nint> indexes] => ref this[indexes]; 329ref readonly T IReadOnlyTensor<Tensor<T>, T>.this[params ReadOnlySpan<NIndex> indexes] => ref this[indexes]; 331ReadOnlyTensorDimensionSpan<T> IReadOnlyTensor<Tensor<T>, T>.GetDimensionSpan(int dimension) => AsReadOnlyTensorSpan().GetDimensionSpan(dimension); 333ref readonly T IReadOnlyTensor<Tensor<T>, T>.GetPinnableReference() => ref GetPinnableReference(); 335ReadOnlySpan<T> IReadOnlyTensor<Tensor<T>, T>.GetSpan(scoped ReadOnlySpan<nint> startIndexes, int length) => AsReadOnlyTensorSpan().GetSpan(startIndexes, length); 337ReadOnlySpan<T> IReadOnlyTensor<Tensor<T>, T>.GetSpan(scoped ReadOnlySpan<NIndex> startIndexes, int length) => AsReadOnlyTensorSpan().GetSpan(startIndexes, length); 371static Tensor<T> ITensor<Tensor<T>, T>.CreateFromShape(scoped ReadOnlySpan<nint> lengths, bool pinned) => Tensor.CreateFromShape<T>(lengths, pinned); 373static Tensor<T> ITensor<Tensor<T>, T>.CreateFromShape(scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides, bool pinned) => Tensor.CreateFromShape<T>(lengths, strides, pinned); 375static Tensor<T> ITensor<Tensor<T>, T>.CreateFromShapeUninitialized(scoped ReadOnlySpan<nint> lengths, bool pinned) => Tensor.CreateFromShapeUninitialized<T>(lengths, pinned); 377static Tensor<T> ITensor<Tensor<T>, T>.CreateFromShapeUninitialized(scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides, bool pinned) => Tensor.CreateFromShapeUninitialized<T>(lengths, strides, pinned); 382private readonly Tensor<T> _tensor; 387internal 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> 57public 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> 70public static Tensor<T> Broadcast<T>(scoped in ReadOnlyTensorSpan<T> source, scoped ReadOnlySpan<nint> lengths) 73Tensor<T> destination = CreateFromShapeUninitialized<T>(lengths); 85public static void BroadcastTo<T>(this Tensor<T> source, in TensorSpan<T> destination) 118public static Tensor<T> Concatenate<T>(params scoped ReadOnlySpan<Tensor<T>> tensors) 129public static Tensor<T> ConcatenateOnDimension<T>(int dimension, params scoped ReadOnlySpan<Tensor<T>> tensors) 143Tensor<T> tensor; 176public static ref readonly TensorSpan<T> Concatenate<T>(scoped ReadOnlySpan<Tensor<T>> tensors, in TensorSpan<T> destination) 188public static ref readonly TensorSpan<T> ConcatenateOnDimension<T>(int dimension, scoped ReadOnlySpan<Tensor<T>> tensors, in TensorSpan<T> destination) 239private static Tensor<T> CreateConcatenationResult<T>(ReadOnlySpan<nint> sourceLengths, int dimension, nint axisLength) 243Tensor<T> result; 258private static void ValidateConcatenationStorage<T>(scoped ReadOnlySpan<Tensor<T>> tensors, in TensorSpan<T> destination) 281private static void CopyConcatenatedValues<T>(int dimension, scoped ReadOnlySpan<Tensor<T>> tensors, 308foreach (Tensor<T> tensor in tensors) 320foreach (Tensor<T> tensor in tensors) 342private static nint GetConcatenatedLength<T>(int dimension, scoped ReadOnlySpan<Tensor<T>> tensors, in TensorShape shape) 360private static bool TryJoinDenseBlocks<T>(int dimension, ReadOnlySpan<Tensor<T>> tensors, 367foreach (Tensor<T> tensor in tensors) 390foreach (Tensor<T> tensor in tensors) 433private static void ConcatenateOnDimensionToSpan<T>(int dimension, scoped ReadOnlySpan<Tensor<T>> tensors, in TensorSpan<T> destination, Span<T> dstSpan) 481public static Tensor<T> Create<T>(T[] array) 486public static Tensor<T> Create<T>(T[] array, scoped ReadOnlySpan<nint> lengths) 491public static Tensor<T> Create<T>(T[] array, scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides) 496public static Tensor<T> Create<T>(T[] array, int start, scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides) 503public static Tensor<T> CreateFromShape<T>(scoped ReadOnlySpan<nint> lengths, bool pinned = false) 508public static Tensor<T> CreateFromShape<T>(scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides, bool pinned = false) 512public static Tensor<T> CreateFromShapeUninitialized<T>(scoped ReadOnlySpan<nint> lengths, bool pinned = false) 516public static Tensor<T> CreateFromShapeUninitialized<T>(scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides, bool pinned = false) 655public static Tensor<bool> Equals<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 658TensorOperation.ValidateCompatibility(x, y, out Tensor<bool> destination); 686public static Tensor<bool> Equals<T>(in ReadOnlyTensorSpan<T> x, T y) 689Tensor<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 811public static Tensor<bool> GreaterThan<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 814TensorOperation.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"/> 847public static Tensor<bool> GreaterThan<T>(in ReadOnlyTensorSpan<T> x, T y) 850Tensor<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"/> 882public 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 992public static Tensor<bool> GreaterThanOrEqual<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 995TensorOperation.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"/> 1028public static Tensor<bool> GreaterThanOrEqual<T>(in ReadOnlyTensorSpan<T> x, T y) 1031Tensor<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"/> 1063public 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 1173public static Tensor<bool> LessThan<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 1176TensorOperation.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"/> 1209public static Tensor<bool> LessThan<T>(in ReadOnlyTensorSpan<T> x, T y) 1212Tensor<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"/> 1244public 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 1354public static Tensor<bool> LessThanOrEqual<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 1357TensorOperation.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"/> 1390public static Tensor<bool> LessThanOrEqual<T>(in ReadOnlyTensorSpan<T> x, T y) 1393Tensor<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"/> 1425public 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> 1533public static Tensor<T> PermuteDimensions<T>(this Tensor<T> tensor, ReadOnlySpan<int> dimensions) 1585Tensor<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> 1694public static Tensor<T> Reshape<T>(this Tensor<T> tensor, ReadOnlySpan<nint> lengths) 1717Tensor<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> 1796public static Tensor<T> Resize<T>(Tensor<T> tensor, ReadOnlySpan<nint> lengths) 1798Tensor<T> output = CreateFromShape<T>(lengths, tensor.IsPinned); 1840/// <param name="tensor">Input <see cref="Tensor{T}"/>.</param> 1842public static void ResizeTo<T>(scoped in Tensor<T> tensor, in TensorSpan<T> destination) 1993/// <param name="tensor">Input <see cref="Tensor{T}"/>.</param> 1994public static Tensor<T> Reverse<T>(in ReadOnlyTensorSpan<T> tensor) 1996Tensor<T> output = CreateFromShape<T>(tensor.Lengths); 2006/// <param name="tensor">Input <see cref="Tensor{T}"/>.</param> 2008public static Tensor<T> ReverseDimension<T>(in ReadOnlyTensorSpan<T> tensor, int dimension) 2010Tensor<T> output = CreateFromShape<T>(tensor.Lengths); 2365/// <param name="tensor">Input <see cref="Tensor{T}"/>.</param> 2368public 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> 2404public static Tensor<T>[] Split<T>(scoped in ReadOnlyTensorSpan<T> tensor, int splitCount, nint dimension) 2419Tensor<T>[] outputs = new Tensor<T>[splitCount]; 2454/// <param name="tensor">The <see cref="Tensor{T}"/> to remove all dimensions of length 1.</param> 2455public 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> 2466public static Tensor<T> SqueezeDimension<T>(this Tensor<T> tensor, int dimension) 2522Tensor<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> 2695public 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> 2706public static Tensor<T> StackAlongDimension<T>(int dimension, params ReadOnlySpan<Tensor<T>> tensors) 2715Tensor<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> 2727public 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> 2739public static ref readonly TensorSpan<T> StackAlongDimension<T>(scoped ReadOnlySpan<Tensor<T>> tensors, in TensorSpan<T> destination, int dimension) 2755private static int ValidateStackInputs<T>(int dimension, scoped ReadOnlySpan<Tensor<T>> tensors) 2782private static void CopyStackValues<T>(int dimension, scoped ReadOnlySpan<Tensor<T>> tensors, 2972/// <param name="tensor">Input <see cref="Tensor{T}"/>.</param> 2973public static Tensor<T> Transpose<T>(Tensor<T> tensor) 2992Tensor<T> output = new Tensor<T>(tensor._values, tensor._start, lengths, strides, tensor.IsPinned); 3006/// <param name="tensor">Input <see cref="Tensor{T}"/>.</param> 3008public 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> 3048public static Tensor<T> Unsqueeze<T>(this Tensor<T> tensor, int dimension) 3087Tensor<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. 3190public static Tensor<T> Abs<T>(in ReadOnlyTensorSpan<T> x) 3193Tensor<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. 3217public static Tensor<T> Acos<T>(in ReadOnlyTensorSpan<T> x) 3220Tensor<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. 3244public static Tensor<T> Acosh<T>(in ReadOnlyTensorSpan<T> x) 3247Tensor<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. 3271public static Tensor<T> AcosPi<T>(in ReadOnlyTensorSpan<T> x) 3274Tensor<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. 3298public static Tensor<T> Asin<T>(in ReadOnlyTensorSpan<T> x) 3301Tensor<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. 3325public static Tensor<T> Asinh<T>(in ReadOnlyTensorSpan<T> x) 3328Tensor<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. 3352public static Tensor<T> AsinPi<T>(in ReadOnlyTensorSpan<T> x) 3355Tensor<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. 3379public static Tensor<T> Atan<T>(in ReadOnlyTensorSpan<T> x) 3382Tensor<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. 3407public static Tensor<T> Atan2<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 3410TensorOperation.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. 3434public static Tensor<T> Atan2<T>(in ReadOnlyTensorSpan<T> x, T y) 3437Tensor<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. 3461public static Tensor<T> Atan2<T>(T x, in ReadOnlyTensorSpan<T> y) 3464Tensor<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. 3490public static Tensor<T> Atan2Pi<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 3493TensorOperation.ValidateCompatibility(x, y, out Tensor<T> destination); 3517public static Tensor<T> Atan2Pi<T>(in ReadOnlyTensorSpan<T> x, T y) 3520Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 3544public static Tensor<T> Atan2Pi<T>(T x, in ReadOnlyTensorSpan<T> y) 3547Tensor<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. 3572public static Tensor<T> Atanh<T>(in ReadOnlyTensorSpan<T> x) 3575Tensor<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. 3599public static Tensor<T> AtanPi<T>(in ReadOnlyTensorSpan<T> x) 3602Tensor<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. 3643public static Tensor<T> Cbrt<T>(in ReadOnlyTensorSpan<T> x) 3646Tensor<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. 3670public static Tensor<T> Ceiling<T>(in ReadOnlyTensorSpan<T> x) 3673Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 3698public static Tensor<TTo> ConvertChecked<TFrom, TTo>(in ReadOnlyTensorSpan<TFrom> source) 3702Tensor<TTo> destination = CreateFromShapeUninitialized<TTo>(source.Lengths); 3729public static Tensor<TTo> ConvertSaturating<TFrom, TTo>(in ReadOnlyTensorSpan<TFrom> source) 3733Tensor<TTo> destination = CreateFromShapeUninitialized<TTo>(source.Lengths); 3760public static Tensor<TTo> ConvertTruncating<TFrom, TTo>(in ReadOnlyTensorSpan<TFrom> source) 3764Tensor<TTo> destination = CreateFromShapeUninitialized<TTo>(source.Lengths); 3791public static Tensor<T> CopySign<T>(in ReadOnlyTensorSpan<T> x, T sign) 3794Tensor<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. 3804public static Tensor<T> CopySign<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> sign) 3807TensorOperation.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. 3846public static Tensor<T> Cos<T>(in ReadOnlyTensorSpan<T> x) 3849Tensor<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. 3873public static Tensor<T> Cosh<T>(in ReadOnlyTensorSpan<T> x) 3876Tensor<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> 3926public static Tensor<T> CosPi<T>(in ReadOnlyTensorSpan<T> x) 3929Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 3963public static Tensor<T> DegreesToRadians<T>(in ReadOnlyTensorSpan<T> x) 3966Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 4022public static Tensor<T> Exp<T>(in ReadOnlyTensorSpan<T> x) 4025Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 4049public static Tensor<T> Exp10<T>(in ReadOnlyTensorSpan<T> x) 4052Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 4074public static Tensor<T> Exp10M1<T>(in ReadOnlyTensorSpan<T> x) 4077Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 4097public static Tensor<T> Exp2<T>(in ReadOnlyTensorSpan<T> x) 4100Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 4120public static Tensor<T> Exp2M1<T>(in ReadOnlyTensorSpan<T> x) 4123Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 4143public static Tensor<T> ExpM1<T>(in ReadOnlyTensorSpan<T> x) 4146Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 4166public static Tensor<T> Floor<T>(in ReadOnlyTensorSpan<T> x) 4169Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 4193public static Tensor<T> Hypot<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 4196TensorOperation.ValidateCompatibility(x, y, out Tensor<T> destination); 4222public static Tensor<T> Ieee754Remainder<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 4225TensorOperation.ValidateCompatibility(x, y, out Tensor<T> destination); 4246public static Tensor<T> Ieee754Remainder<T>(in ReadOnlyTensorSpan<T> x, T y) 4249Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 4269public static Tensor<T> Ieee754Remainder<T>(T x, in ReadOnlyTensorSpan<T> y) 4272Tensor<T> destination = CreateFromShapeUninitialized<T>(y.Lengths); 4293public static Tensor<int> ILogB<T>(in ReadOnlyTensorSpan<T> x) 4296Tensor<int> destination = CreateFromShapeUninitialized<int>(x.Lengths); 4361public static Tensor<T> LeadingZeroCount<T>(in ReadOnlyTensorSpan<T> x) 4364Tensor<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. 4388public static Tensor<T> Log<T>(in ReadOnlyTensorSpan<T> x) 4391Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 4412public static Tensor<T> Log<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 4415TensorOperation.ValidateCompatibility(x, y, out Tensor<T> destination); 4435public static Tensor<T> Log<T>(in ReadOnlyTensorSpan<T> x, T y) 4438Tensor<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. 4461public static Tensor<T> Log10<T>(in ReadOnlyTensorSpan<T> x) 4464Tensor<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. 4488public static Tensor<T> Log10P1<T>(in ReadOnlyTensorSpan<T> x) 4491Tensor<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. 4515public static Tensor<T> Log2<T>(in ReadOnlyTensorSpan<T> x) 4518Tensor<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. 4542public static Tensor<T> Log2P1<T>(in ReadOnlyTensorSpan<T> x) 4545Tensor<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. 4569public static Tensor<T> LogP1<T>(in ReadOnlyTensorSpan<T> x) 4572Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 4610public static Tensor<T> Max<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 4613TensorOperation.ValidateCompatibility(in x, in y, out Tensor<T> output); 4633public static Tensor<T> Max<T>(in ReadOnlyTensorSpan<T> x, T y) 4636Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 4673public static Tensor<T> MaxMagnitude<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 4676TensorOperation.ValidateCompatibility(in x, in y, out Tensor<T> destination); 4696public static Tensor<T> MaxMagnitude<T>(in ReadOnlyTensorSpan<T> x, T y) 4699Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 4736public static Tensor<T> MaxMagnitudeNumber<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 4739TensorOperation.ValidateCompatibility(in x, in y, out Tensor<T> destination); 4759public static Tensor<T> MaxMagnitudeNumber<T>(in ReadOnlyTensorSpan<T> x, T y) 4762Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 4799public static Tensor<T> MaxNumber<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 4802TensorOperation.ValidateCompatibility(in x, in y, out Tensor<T> destination); 4822public static Tensor<T> MaxNumber<T>(in ReadOnlyTensorSpan<T> x, T y) 4825Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 4862public static Tensor<T> Min<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 4865TensorOperation.ValidateCompatibility(in x, in y, out Tensor<T> output); 4885public static Tensor<T> Min<T>(in ReadOnlyTensorSpan<T> x, T y) 4888Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 4925public static Tensor<T> MinMagnitude<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 4928TensorOperation.ValidateCompatibility(in x, in y, out Tensor<T> destination); 4948public static Tensor<T> MinMagnitude<T>(in ReadOnlyTensorSpan<T> x, T y) 4951Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 4988public static Tensor<T> MinMagnitudeNumber<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 4991TensorOperation.ValidateCompatibility(in x, in y, out Tensor<T> destination); 5011public static Tensor<T> MinMagnitudeNumber<T>(in ReadOnlyTensorSpan<T> x, T y) 5014Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 5051public static Tensor<T> MinNumber<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 5054TensorOperation.ValidateCompatibility(in x, in y, out Tensor<T> destination); 5074public static Tensor<T> MinNumber<T>(in ReadOnlyTensorSpan<T> x, T y) 5077Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 5112public static Tensor<T> PopCount<T>(in ReadOnlyTensorSpan<T> x) 5115Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 5136public static Tensor<T> Pow<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 5139TensorOperation.ValidateCompatibility(x, y, out Tensor<T> destination); 5159public static Tensor<T> Pow<T>(in ReadOnlyTensorSpan<T> x, T y) 5162Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 5182public static Tensor<T> Pow<T>(T x, in ReadOnlyTensorSpan<T> y) 5185Tensor<T> destination = CreateFromShapeUninitialized<T>(y.Lengths); 5218public static Tensor<T> RadiansToDegrees<T>(in ReadOnlyTensorSpan<T> x) 5221Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 5241public static Tensor<T> Reciprocal<T>(in ReadOnlyTensorSpan<T> x) 5244Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 5265public static Tensor<T> RootN<T>(in ReadOnlyTensorSpan<T> x, int n) 5268Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 5291public static Tensor<T> RotateLeft<T>(in ReadOnlyTensorSpan<T> x, int rotateAmount) 5294Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 5318public static Tensor<T> RotateRight<T>(in ReadOnlyTensorSpan<T> x, int rotateAmount) 5321Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 5343public static Tensor<T> Round<T>(in ReadOnlyTensorSpan<T> x) 5346Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 5366public static Tensor<T> Round<T>(in ReadOnlyTensorSpan<T> x, int digits, MidpointRounding mode) 5369Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 5390public static Tensor<T> Round<T>(in ReadOnlyTensorSpan<T> x, int digits) 5393Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 5413public static Tensor<T> Round<T>(in ReadOnlyTensorSpan<T> x, MidpointRounding mode) 5416Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 5437public static Tensor<T> Sigmoid<T>(in ReadOnlyTensorSpan<T> x) 5440Tensor<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. 5462public static Tensor<T> Sin<T>(in ReadOnlyTensorSpan<T> x) 5465Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 5487public static Tensor<T> Sinh<T>(in ReadOnlyTensorSpan<T> x) 5490Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 5510public static Tensor<T> SinPi<T>(in ReadOnlyTensorSpan<T> x) 5513Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 5533public static Tensor<T> SoftMax<T>(in ReadOnlyTensorSpan<T> x) 5539Tensor<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. 5563public static Tensor<T> Sqrt<T>(in ReadOnlyTensorSpan<T> x) 5566Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 5635public static Tensor<T> Tan<T>(in ReadOnlyTensorSpan<T> x) 5638Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 5658public static Tensor<T> Tanh<T>(in ReadOnlyTensorSpan<T> x) 5661Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 5681public static Tensor<T> TanPi<T>(in ReadOnlyTensorSpan<T> x) 5684Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 5704public static Tensor<T> TrailingZeroCount<T>(in ReadOnlyTensorSpan<T> x) 5707Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 5727public static Tensor<T> Truncate<T>(in ReadOnlyTensorSpan<T> x) 5730Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
System\Numerics\Tensors\netcore\Tensor.op_Addition.cs (18)
14public static Tensor<T> Add<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 17TensorOperation.ValidateCompatibility(x, y, out Tensor<T> destination); 27public static Tensor<T> Add<T>(in ReadOnlyTensorSpan<T> x, T y) 30Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 74public static Tensor<TScalar> operator +(in ReadOnlyTensorSpan<TScalar> left, in ReadOnlyTensorSpan<TScalar> right) => Add(left, right); 80public static Tensor<TScalar> operator +(in ReadOnlyTensorSpan<TScalar> left, TScalar right) => Add(left, right); 86public static Tensor<TScalar> operator +(TScalar left, in ReadOnlyTensorSpan<TScalar> right) => Add(right, left); 90extension<TScalar>(Tensor<TScalar> tensor) 94public static Tensor<TScalar> operator +(Tensor<TScalar> left, Tensor<TScalar> right) => Add<TScalar>(left, right); 97public static Tensor<TScalar> operator +(Tensor<TScalar> left, TScalar right) => Add(left, right); 100public static Tensor<TScalar> operator +(TScalar left, Tensor<TScalar> right) => Add(right, left); 115public static Tensor<TScalar> operator +(in TensorSpan<TScalar> left, in TensorSpan<TScalar> right) => Add<TScalar>(left, right); 118public static Tensor<TScalar> operator +(in TensorSpan<TScalar> left, TScalar right) => Add(left, right); 121public static Tensor<TScalar> operator +(TScalar left, in TensorSpan<TScalar> right) => Add(right, left);
System\Numerics\Tensors\netcore\Tensor.op_BitwiseAnd.cs (18)
14public static Tensor<T> BitwiseAnd<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 17TensorOperation.ValidateCompatibility(x, y, out Tensor<T> destination); 27public static Tensor<T> BitwiseAnd<T>(in ReadOnlyTensorSpan<T> x, T y) 30Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 74public static Tensor<TScalar> operator &(in ReadOnlyTensorSpan<TScalar> left, in ReadOnlyTensorSpan<TScalar> right) => BitwiseAnd(left, right); 80public static Tensor<TScalar> operator &(in ReadOnlyTensorSpan<TScalar> left, TScalar right) => BitwiseAnd(left, right); 86public static Tensor<TScalar> operator &(TScalar left, in ReadOnlyTensorSpan<TScalar> right) => BitwiseAnd(right, left); 90extension<TScalar>(Tensor<TScalar> tensor) 94public static Tensor<TScalar> operator &(Tensor<TScalar> left, Tensor<TScalar> right) => BitwiseAnd<TScalar>(left, right); 97public static Tensor<TScalar> operator &(Tensor<TScalar> left, TScalar right) => BitwiseAnd(left, right); 100public static Tensor<TScalar> operator &(TScalar left, Tensor<TScalar> right) => BitwiseAnd(right, left); 115public static Tensor<TScalar> operator &(in TensorSpan<TScalar> left, in TensorSpan<TScalar> right) => BitwiseAnd<TScalar>(left, right); 118public static Tensor<TScalar> operator &(in TensorSpan<TScalar> left, TScalar right) => BitwiseAnd(left, right); 121public static Tensor<TScalar> operator &(TScalar left, in TensorSpan<TScalar> right) => BitwiseAnd(right, left);
System\Numerics\Tensors\netcore\Tensor.op_BitwiseOr.cs (18)
14public static Tensor<T> BitwiseOr<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 17TensorOperation.ValidateCompatibility(x, y, out Tensor<T> destination); 27public static Tensor<T> BitwiseOr<T>(in ReadOnlyTensorSpan<T> x, T y) 30Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 74public static Tensor<TScalar> operator |(in ReadOnlyTensorSpan<TScalar> left, in ReadOnlyTensorSpan<TScalar> right) => BitwiseOr(left, right); 80public static Tensor<TScalar> operator |(in ReadOnlyTensorSpan<TScalar> left, TScalar right) => BitwiseOr(left, right); 86public static Tensor<TScalar> operator |(TScalar left, in ReadOnlyTensorSpan<TScalar> right) => BitwiseOr(right, left); 90extension<TScalar>(Tensor<TScalar> tensor) 94public static Tensor<TScalar> operator |(Tensor<TScalar> left, Tensor<TScalar> right) => BitwiseOr<TScalar>(left, right); 97public static Tensor<TScalar> operator |(Tensor<TScalar> left, TScalar right) => BitwiseOr(left, right); 100public static Tensor<TScalar> operator |(TScalar left, Tensor<TScalar> right) => BitwiseOr(right, left); 115public static Tensor<TScalar> operator |(in TensorSpan<TScalar> left, in TensorSpan<TScalar> right) => BitwiseOr<TScalar>(left, right); 118public static Tensor<TScalar> operator |(in TensorSpan<TScalar> left, TScalar right) => BitwiseOr(left, right); 121public static Tensor<TScalar> operator |(TScalar left, in TensorSpan<TScalar> right) => BitwiseOr(right, left);
System\Numerics\Tensors\netcore\Tensor.op_Decrement.cs (3)
12public static Tensor<T> Decrement<T>(in ReadOnlyTensorSpan<T> x) 15Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 36extension<TScalar>(Tensor<TScalar> tensor)
System\Numerics\Tensors\netcore\Tensor.op_Division.cs (20)
14public static Tensor<T> Divide<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 17TensorOperation.ValidateCompatibility(x, y, out Tensor<T> destination); 27public static Tensor<T> Divide<T>(in ReadOnlyTensorSpan<T> x, T y) 30Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 40public static Tensor<T> Divide<T>(T x, in ReadOnlyTensorSpan<T> y) 43Tensor<T> destination = CreateFromShapeUninitialized<T>(y.Lengths); 101public static Tensor<TScalar> operator /(in ReadOnlyTensorSpan<TScalar> left, in ReadOnlyTensorSpan<TScalar> right) => Divide(left, right); 107public static Tensor<TScalar> operator /(in ReadOnlyTensorSpan<TScalar> left, TScalar right) => Divide(left, right); 113public static Tensor<TScalar> operator /(TScalar left, in ReadOnlyTensorSpan<TScalar> right) => Divide(left, right); 117extension<TScalar>(Tensor<TScalar> tensor) 121public static Tensor<TScalar> operator /(Tensor<TScalar> left, Tensor<TScalar> right) => Divide<TScalar>(left, right); 124public static Tensor<TScalar> operator /(Tensor<TScalar> left, TScalar right) => Divide(left, right); 127public static Tensor<TScalar> operator /(TScalar left, Tensor<TScalar> right) => Divide(left, right); 142public static Tensor<TScalar> operator /(in TensorSpan<TScalar> left, in TensorSpan<TScalar> right) => Divide<TScalar>(left, right); 145public static Tensor<TScalar> operator /(in TensorSpan<TScalar> left, TScalar right) => Divide(left, right); 148public static Tensor<TScalar> operator /(TScalar left, in TensorSpan<TScalar> right) => Divide(left, right);
System\Numerics\Tensors\netcore\Tensor.op_ExclusiveOr.cs (18)
14public static Tensor<T> Xor<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 17TensorOperation.ValidateCompatibility(x, y, out Tensor<T> destination); 27public static Tensor<T> Xor<T>(in ReadOnlyTensorSpan<T> x, T y) 30Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 74public static Tensor<TScalar> operator ^(in ReadOnlyTensorSpan<TScalar> left, in ReadOnlyTensorSpan<TScalar> right) => Xor(left, right); 80public static Tensor<TScalar> operator ^(in ReadOnlyTensorSpan<TScalar> left, TScalar right) => Xor(left, right); 86public static Tensor<TScalar> operator ^(TScalar left, in ReadOnlyTensorSpan<TScalar> right) => Xor(right, left); 90extension<TScalar>(Tensor<TScalar> tensor) 94public static Tensor<TScalar> operator ^(Tensor<TScalar> left, Tensor<TScalar> right) => Xor<TScalar>(left, right); 97public static Tensor<TScalar> operator ^(Tensor<TScalar> left, TScalar right) => Xor(left, right); 100public static Tensor<TScalar> operator ^(TScalar left, Tensor<TScalar> right) => Xor(right, left); 115public static Tensor<TScalar> operator ^(in TensorSpan<TScalar> left, in TensorSpan<TScalar> right) => Xor<TScalar>(left, right); 118public static Tensor<TScalar> operator ^(in TensorSpan<TScalar> left, TScalar right) => Xor(left, right); 121public static Tensor<TScalar> operator ^(TScalar left, in TensorSpan<TScalar> right) => Xor(right, left);
System\Numerics\Tensors\netcore\Tensor.op_Increment.cs (3)
12public static Tensor<T> Increment<T>(in ReadOnlyTensorSpan<T> x) 15Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 36extension<TScalar>(Tensor<TScalar> tensor)
System\Numerics\Tensors\netcore\Tensor.op_LeftShift.cs (8)
13public static Tensor<T> ShiftLeft<T>(in ReadOnlyTensorSpan<T> x, int shiftAmount) 16Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 44public static Tensor<TScalar> operator <<(in ReadOnlyTensorSpan<TScalar> tensor, int shiftAmount) => ShiftLeft(tensor, shiftAmount); 48extension<TScalar>(Tensor<TScalar>) 52public static Tensor<TScalar> operator <<(Tensor<TScalar> tensor, int shiftAmount) => ShiftLeft<TScalar>(tensor, shiftAmount); 57extension<TScalar>(Tensor<TScalar> tensor) 69public static Tensor<TScalar> operator <<(in TensorSpan<TScalar> tensor, int shiftAmount) => ShiftLeft<TScalar>(tensor, shiftAmount);
System\Numerics\Tensors\netcore\Tensor.op_Multiply.cs (18)
14public static Tensor<T> Multiply<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 17TensorOperation.ValidateCompatibility(x, y, out Tensor<T> destination); 27public static Tensor<T> Multiply<T>(in ReadOnlyTensorSpan<T> x, T y) 30Tensor<T> destination = CreateFromShape<T>(x.Lengths); 74public static Tensor<TScalar> operator *(in ReadOnlyTensorSpan<TScalar> left, in ReadOnlyTensorSpan<TScalar> right) => Multiply(left, right); 80public static Tensor<TScalar> operator *(in ReadOnlyTensorSpan<TScalar> left, TScalar right) => Multiply(left, right); 86public static Tensor<TScalar> operator *(TScalar left, in ReadOnlyTensorSpan<TScalar> right) => Multiply(right, left); 90extension<TScalar>(Tensor<TScalar> tensor) 94public static Tensor<TScalar> operator *(Tensor<TScalar> left, Tensor<TScalar> right) => Multiply<TScalar>(left, right); 97public static Tensor<TScalar> operator *(Tensor<TScalar> left, TScalar right) => Multiply(left, right); 100public static Tensor<TScalar> operator *(TScalar left, Tensor<TScalar> right) => Multiply(right, left); 115public static Tensor<TScalar> operator *(in TensorSpan<TScalar> left, in TensorSpan<TScalar> right) => Multiply<TScalar>(left, right); 118public static Tensor<TScalar> operator *(in TensorSpan<TScalar> left, TScalar right) => Multiply(left, right); 121public static Tensor<TScalar> operator *(TScalar left, in TensorSpan<TScalar> right) => Multiply(right, left);
System\Numerics\Tensors\netcore\Tensor.op_OnesComplement.cs (7)
12public static Tensor<T> OnesComplement<T>(in ReadOnlyTensorSpan<T> x) 15Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 41public static Tensor<TScalar> operator ~(in ReadOnlyTensorSpan<TScalar> tensor) => OnesComplement(tensor); 45extension<TScalar>(Tensor<TScalar>) 49public static Tensor<TScalar> operator ~(Tensor<TScalar> tensor) => OnesComplement<TScalar>(tensor); 57public static Tensor<TScalar> operator ~(in TensorSpan<TScalar> tensor) => OnesComplement<TScalar>(tensor);
System\Numerics\Tensors\netcore\Tensor.op_RightShift.cs (8)
13public static Tensor<T> ShiftRightArithmetic<T>(in ReadOnlyTensorSpan<T> x, int shiftAmount) 16Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 44public static Tensor<TScalar> operator >>(in ReadOnlyTensorSpan<TScalar> tensor, int shiftAmount) => ShiftRightArithmetic(tensor, shiftAmount); 48extension<TScalar>(Tensor<TScalar>) 52public static Tensor<TScalar> operator >>(Tensor<TScalar> tensor, int shiftAmount) => ShiftRightArithmetic<TScalar>(tensor, shiftAmount); 57extension<TScalar>(Tensor<TScalar> tensor) 69public static Tensor<TScalar> operator >>(in TensorSpan<TScalar> tensor, int shiftAmount) => ShiftRightArithmetic<TScalar>(tensor, shiftAmount);
System\Numerics\Tensors\netcore\Tensor.op_Subtraction.cs (20)
14public static Tensor<T> Subtract<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 17TensorOperation.ValidateCompatibility(x, y, out Tensor<T> destination); 27public static Tensor<T> Subtract<T>(in ReadOnlyTensorSpan<T> x, T y) 30Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 40public static Tensor<T> Subtract<T>(T x, in ReadOnlyTensorSpan<T> y) 43Tensor<T> destination = CreateFromShapeUninitialized<T>(y.Lengths); 102public static Tensor<TScalar> operator -(in ReadOnlyTensorSpan<TScalar> left, in ReadOnlyTensorSpan<TScalar> right) => Subtract(left, right); 108public static Tensor<TScalar> operator -(in ReadOnlyTensorSpan<TScalar> left, TScalar right) => Subtract(left, right); 114public static Tensor<TScalar> operator -(TScalar left, in ReadOnlyTensorSpan<TScalar> right) => Subtract(left, right); 118extension<TScalar>(Tensor<TScalar> tensor) 122public static Tensor<TScalar> operator -(Tensor<TScalar> left, Tensor<TScalar> right) => Subtract<TScalar>(left, right); 125public static Tensor<TScalar> operator -(Tensor<TScalar> left, TScalar right) => Subtract(left, right); 128public static Tensor<TScalar> operator -(TScalar left, Tensor<TScalar> right) => Subtract(left, right); 143public static Tensor<TScalar> operator -(in TensorSpan<TScalar> left, in TensorSpan<TScalar> right) => Subtract<TScalar>(left, right); 146public static Tensor<TScalar> operator -(in TensorSpan<TScalar> left, TScalar right) => Subtract(left, right); 149public static Tensor<TScalar> operator -(TScalar left, in TensorSpan<TScalar> right) => Subtract(left, right);
System\Numerics\Tensors\netcore\Tensor.op_UnaryNegation.cs (7)
11public static Tensor<T> Negate<T>(in ReadOnlyTensorSpan<T> x) 14Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 39public static Tensor<TScalar> operator -(in ReadOnlyTensorSpan<TScalar> tensor) => Negate(tensor); 43extension<TScalar>(Tensor<TScalar>) 47public static Tensor<TScalar> operator -(Tensor<TScalar> tensor) => Negate<TScalar>(tensor); 55public static Tensor<TScalar> operator -(in TensorSpan<TScalar> tensor) => Negate<TScalar>(tensor);
System\Numerics\Tensors\netcore\Tensor.op_UnaryPlus.cs (3)
19extension<TScalar>(Tensor<TScalar>) 23public static Tensor<TScalar> operator +(Tensor<TScalar> tensor) => tensor;
System\Numerics\Tensors\netcore\Tensor.op_UnsignedRightShift.cs (8)
13public static Tensor<T> ShiftRightLogical<T>(in ReadOnlyTensorSpan<T> x, int shiftAmount) 16Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 44public static Tensor<TScalar> operator >>>(in ReadOnlyTensorSpan<TScalar> tensor, int shiftAmount) => ShiftRightLogical(tensor, shiftAmount); 48extension<TScalar>(Tensor<TScalar>) 52public static Tensor<TScalar> operator >>>(Tensor<TScalar> tensor, int shiftAmount) => ShiftRightLogical<TScalar>(tensor, shiftAmount); 57extension<TScalar>(Tensor<TScalar> tensor) 69public static Tensor<TScalar> operator >>>(in TensorSpan<TScalar> tensor, int shiftAmount) => ShiftRightLogical<TScalar>(tensor, shiftAmount);
System\Numerics\Tensors\netcore\TensorOperation.cs (1)
1490public 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>