17 instantiations of Tensor
System.Numerics.Tensors (17)
System\Numerics\Tensors\netcore\Tensor.cs (13)
322=> new Tensor<T>(array); 327=> new Tensor<T>(array, lengths, strides: []); 332=> new Tensor<T>(array, lengths, strides); 337=> new Tensor<T>(array, start, lengths, strides); 344=> new Tensor<T>(lengths, strides: [], pinned); 349=> new Tensor<T>(lengths, strides, pinned); 360return new Tensor<T>(values, in shape); 1359outTensor = new Tensor<T>(tensor._values, tensor._start, newLengths, newStrides); 1440return new Tensor<T>(tensor._values, tensor._start, newLengths, strides); 1888outputs[i] = new Tensor<T>(values, newLengths, strides: []); 1959Tensor<T> output = new Tensor<T>(tensor._values, tensor._start, lengths[..rank], strides[..rank]); 2350Tensor<T> output = new Tensor<T>(tensor._values, tensor._start, lengths, strides); 2431Tensor<T> output = new Tensor<T>(tensor._values, tensor._start, newLengths, newStrides);
System\Numerics\Tensors\netcore\Tensor_1.cs (4)
21public static Tensor<T> Empty { get; } = new(); 222return new Tensor<T>( 237return new Tensor<T>( 252return new Tensor<T>(
437 references to Tensor
System.Numerics.Tensors (437)
System\Numerics\Tensors\netcore\ReadOnlyTensorSpan_1.cs (1)
527Tensor<T> tmp = Tensor.CreateFromShape<T>(Lengths, IsPinned);
System\Numerics\Tensors\netcore\Tensor.cs (390)
51/// Broadcast the data from <paramref name="source"/> to the smallest broadcastable shape compatible with <paramref name="lengthsSource"/>. Creates a new <see cref="Tensor{T}"/> and allocates new memory. 53/// <param name="source">Input <see cref="Tensor{T}"/>.</param> 54/// <param name="lengthsSource">Other <see cref="Tensor{T}"/> to make shapes broadcastable.</param> 55public static Tensor<T> Broadcast<T>(scoped in ReadOnlyTensorSpan<T> source, scoped in ReadOnlyTensorSpan<T> lengthsSource) 61/// Broadcast the data from <paramref name="source"/> to the new shape <paramref name="lengths"/>. Creates a new <see cref="Tensor{T}"/> and allocates new memory. 64/// <param name="source">Input <see cref="Tensor{T}"/>.</param> 67public static Tensor<T> Broadcast<T>(scoped in ReadOnlyTensorSpan<T> source, scoped ReadOnlySpan<nint> lengths) 70Tensor<T> destination = CreateFromShapeUninitialized<T>(lengths); 82public static void BroadcastTo<T>(this Tensor<T> source, in TensorSpan<T> destination) 116public static Tensor<T> Concatenate<T>(params scoped ReadOnlySpan<Tensor<T>> tensors) 126public static Tensor<T> ConcatenateOnDimension<T>(int dimension, params scoped ReadOnlySpan<Tensor<T>> tensors) 134Tensor<T> tensor; 187public static ref readonly TensorSpan<T> Concatenate<T>(scoped ReadOnlySpan<Tensor<T>> tensors, in TensorSpan<T> destination) 199public static ref readonly TensorSpan<T> ConcatenateOnDimension<T>(int dimension, scoped ReadOnlySpan<Tensor<T>> tensors, in TensorSpan<T> destination) 279private static void ConcatenateOnDimensionToSpan<T>(int dimension, scoped ReadOnlySpan<Tensor<T>> tensors, in TensorSpan<T> destination, Span<T> dstSpan) 306Tensor<T> slice = tensors[i].Slice(ranges); 321public static Tensor<T> Create<T>(T[] array) 326public static Tensor<T> Create<T>(T[] array, scoped ReadOnlySpan<nint> lengths) 331public static Tensor<T> Create<T>(T[] array, scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides) 336public static Tensor<T> Create<T>(T[] array, int start, scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides) 343public static Tensor<T> CreateFromShape<T>(scoped ReadOnlySpan<nint> lengths, bool pinned = false) 348public static Tensor<T> CreateFromShape<T>(scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides, bool pinned = false) 352public static Tensor<T> CreateFromShapeUninitialized<T>(scoped ReadOnlySpan<nint> lengths, bool pinned = false) 356public static Tensor<T> CreateFromShapeUninitialized<T>(scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides, bool pinned = false) 445public static Tensor<bool> Equals<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 448TensorOperation.ValidateCompatibility(x, y, out Tensor<bool> destination); 476public static Tensor<bool> Equals<T>(in ReadOnlyTensorSpan<T> x, T y) 479Tensor<bool> destination = CreateFromShapeUninitialized<bool>(x.Lengths); 565/// <param name="tensor">Input <see cref="Tensor{T}"/>.</param> 579/// <param name="tensor">Input <see cref="Tensor{T}"/>.</param> 594/// 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"/> 599/// <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 601public static Tensor<bool> GreaterThan<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 604TensorOperation.ValidateCompatibility(x, y, out Tensor<bool> destination); 612/// 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"/> 618/// <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 630/// 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"/> 635/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/> 637public static Tensor<bool> GreaterThan<T>(in ReadOnlyTensorSpan<T> x, T y) 640Tensor<bool> destination = CreateFromShape<bool>(x.Lengths, false); 647/// 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"/> 653/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/> 665/// 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"/> 670/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/> 672public static Tensor<bool> GreaterThan<T>(T x, in ReadOnlyTensorSpan<T> y) 677/// 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"/> 683/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/> 775/// 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"/> 780/// <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 782public static Tensor<bool> GreaterThanOrEqual<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 785TensorOperation.ValidateCompatibility(x, y, out Tensor<bool> destination); 793/// 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>A <see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/> and 811/// 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"/> 816/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/> 818public static Tensor<bool> GreaterThanOrEqual<T>(in ReadOnlyTensorSpan<T> x, T y) 821Tensor<bool> destination = CreateFromShape<bool>(x.Lengths, false); 828/// 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"/> 834/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/> 846/// 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"/> 851/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/> 853public static Tensor<bool> GreaterThanOrEqual<T>(T x, in ReadOnlyTensorSpan<T> y) 858/// 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"/> 864/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/> 956/// 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"/> 961/// <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 963public static Tensor<bool> LessThan<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 966TensorOperation.ValidateCompatibility(x, y, out Tensor<bool> destination); 974/// 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"/> 980/// <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 991/// Compares the elements of a <see cref="Tensor{T}"/> to see which elements are less than <paramref name="y"/>. 992/// 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"/> 995/// <param name="x"><see cref="Tensor{T}"/> to compare.</param> 997/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/> 999public static Tensor<bool> LessThan<T>(in ReadOnlyTensorSpan<T> x, T y) 1002Tensor<bool> destination = CreateFromShape<bool>(x.Lengths, false); 1008/// Compares the elements of a <see cref="Tensor{T}"/> to see which elements are less than <paramref name="y"/>. 1009/// 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"/> 1012/// <param name="x"><see cref="Tensor{T}"/> to compare.</param> 1015/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/> 1026/// Compares the elements of a <see cref="Tensor{T}"/> to see which elements are less than <paramref name="y"/>. 1027/// 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"/> 1030/// <param name="x"><see cref="Tensor{T}"/> to compare.</param> 1032/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/> 1034public static Tensor<bool> LessThan<T>(T x, in ReadOnlyTensorSpan<T> y) 1038/// Compares the elements of a <see cref="Tensor{T}"/> to see which elements are less than <paramref name="y"/>. 1039/// 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"/> 1042/// <param name="x"><see cref="Tensor{T}"/> to compare.</param> 1045/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/> 1137/// 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"/> 1142/// <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 1144public static Tensor<bool> LessThanOrEqual<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 1147TensorOperation.ValidateCompatibility(x, y, out Tensor<bool> destination); 1155/// 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"/> 1161/// <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 1172/// Compares the elements of a <see cref="Tensor{T}"/> to see which elements are less than <paramref name="y"/>. 1173/// 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"/> 1176/// <param name="x"><see cref="Tensor{T}"/> to compare.</param> 1178/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/> 1180public static Tensor<bool> LessThanOrEqual<T>(in ReadOnlyTensorSpan<T> x, T y) 1183Tensor<bool> destination = CreateFromShape<bool>(x.Lengths, false); 1189/// Compares the elements of a <see cref="Tensor{T}"/> to see which elements are less than <paramref name="y"/>. 1190/// 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"/> 1193/// <param name="x"><see cref="Tensor{T}"/> to compare.</param> 1196/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/> 1207/// Compares the elements of a <see cref="Tensor{T}"/> to see which elements are less than <paramref name="y"/>. 1208/// 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"/> 1211/// <param name="x"><see cref="Tensor{T}"/> to compare.</param> 1213/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/> 1215public static Tensor<bool> LessThanOrEqual<T>(T x, in ReadOnlyTensorSpan<T> y) 1219/// Compares the elements of a <see cref="Tensor{T}"/> to see which elements are less than <paramref name="y"/>. 1220/// 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"/> 1223/// <param name="x"><see cref="Tensor{T}"/> to compare.</param> 1226/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/> 1318/// If <paramref name="tensor"/> is a 1D tensor, it will return <paramref name="tensor"/>. Otherwise it creates a new <see cref="Tensor{T}"/> 1321/// <param name="tensor">Input <see cref="Tensor{T}"/></param> 1323public static Tensor<T> PermuteDimensions<T>(this Tensor<T> tensor, ReadOnlySpan<int> dimensions) 1337Tensor<T> outTensor; 1375/// <param name="tensor"><see cref="Tensor{T}"/> you want to reshape.</param> 1377public static Tensor<T> Reshape<T>(this Tensor<T> tensor, ReadOnlySpan<nint> lengths) 1597/// 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 1600/// <param name="tensor">Input <see cref="Tensor{T}"/>.</param> 1602public static Tensor<T> Resize<T>(Tensor<T> tensor, ReadOnlySpan<nint> lengths) 1606Tensor<T> output = Create(values, lengths, []); 1642/// <param name="tensor">Input <see cref="Tensor{T}"/>.</param> 1644public static void ResizeTo<T>(scoped in Tensor<T> tensor, in TensorSpan<T> destination) 1702/// <param name="tensor">Input <see cref="Tensor{T}"/>.</param> 1703public static Tensor<T> Reverse<T>(in ReadOnlyTensorSpan<T> tensor) 1705Tensor<T> output = CreateFromShape<T>(tensor.Lengths); 1715/// <param name="tensor">Input <see cref="Tensor{T}"/>.</param> 1717public static Tensor<T> ReverseDimension<T>(in ReadOnlyTensorSpan<T> tensor, int dimension) 1719Tensor<T> output = CreateFromShape<T>(tensor.Lengths); 1826/// <param name="tensor">Input <see cref="Tensor{T}"/>.</param> 1829public static Tensor<T> SetSlice<T>(this Tensor<T> tensor, in ReadOnlyTensorSpan<T> values, params ReadOnlySpan<NRange> ranges) 1838/// <param name="tensor">Input <see cref="Tensor{T}"/>.</param> 1857/// Split a <see cref="Tensor{T}"/> into <paramref name="splitCount"/> along the given <paramref name="dimension"/>. If the tensor cannot be split 1860/// <param name="tensor">Input <see cref="Tensor{T}"/>.</param> 1863public static Tensor<T>[] Split<T>(scoped in ReadOnlyTensorSpan<T> tensor, int splitCount, nint dimension) 1870Tensor<T>[] outputs = new Tensor<T>[splitCount]; 1903/// <param name="tensor">The <see cref="Tensor{T}"/> to remove all dimensions of length 1.</param> 1904public static Tensor<T> Squeeze<T>(this Tensor<T> tensor) 1913/// <param name="tensor">The <see cref="Tensor{T}"/> to remove dimension of length 1.</param> 1915public static Tensor<T> SqueezeDimension<T>(this Tensor<T> tensor, int dimension) 1959Tensor<T> output = new Tensor<T>(tensor._values, tensor._start, lengths[..rank], strides[..rank]); 2104/// Join multiple <see cref="Tensor{T}"/> along a new dimension that is added at position 0. All tensors must have the same shape. 2106/// <param name="tensors">Input <see cref="Tensor{T}"/>.</param> 2107public static Tensor<T> Stack<T>(params ReadOnlySpan<Tensor<T>> tensors) 2113/// Join multiple <see cref="Tensor{T}"/> along a new dimension. The axis parameter specifies the index of the new dimension. All tensors must have the same shape. 2115/// <param name="tensors">Input <see cref="Tensor{T}"/>.</param> 2117public static Tensor<T> StackAlongDimension<T>(int dimension, params ReadOnlySpan<Tensor<T>> tensors) 2133Tensor<T>[] outputs = new Tensor<T>[tensors.Length]; 2142/// Join multiple <see cref="Tensor{T}"/> along a new dimension that is added at position 0. All tensors must have the same shape. 2144/// <param name="tensors">Input <see cref="Tensor{T}"/>.</param> 2146public static ref readonly TensorSpan<T> Stack<T>(scoped in ReadOnlySpan<Tensor<T>> tensors, in TensorSpan<T> destination) 2152/// Join multiple <see cref="Tensor{T}"/> along a new dimension. The axis parameter specifies the index of the new dimension. All tensors must have the same shape. 2154/// <param name="tensors">Input <see cref="Tensor{T}"/>.</param> 2157public static ref readonly TensorSpan<T> StackAlongDimension<T>(scoped ReadOnlySpan<Tensor<T>> tensors, in TensorSpan<T> destination, int dimension) 2173Tensor<T>[] outputs = new Tensor<T>[tensors.Length]; 2330/// <param name="tensor">Input <see cref="Tensor{T}"/>.</param> 2331public static Tensor<T> Transpose<T>(Tensor<T> tensor) 2350Tensor<T> output = new Tensor<T>(tensor._values, tensor._start, lengths, strides); 2364/// <param name="tensor">Input <see cref="Tensor{T}"/>.</param> 2366public static bool TryBroadcastTo<T>(this Tensor<T> tensor, in TensorSpan<T> destination) 2403/// <param name="tensor">The <see cref="Tensor{T}"/> to add a dimension of length 1.</param> 2405public static Tensor<T> Unsqueeze<T>(this Tensor<T> tensor, int dimension) 2431Tensor<T> output = new Tensor<T>(tensor._values, tensor._start, newLengths, newStrides); 2515/// Takes the absolute value of each element of the <see cref="Tensor{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 2518public static Tensor<T> Abs<T>(in ReadOnlyTensorSpan<T> x) 2521Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 2542/// Takes the inverse cosine of each element of the <see cref="Tensor{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 2545public static Tensor<T> Acos<T>(in ReadOnlyTensorSpan<T> x) 2548Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 2554/// Takes the inverse cosine of each element of the <see cref="Tensor{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 2569/// 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. 2572public static Tensor<T> Acosh<T>(in ReadOnlyTensorSpan<T> x) 2575Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 2596/// 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. 2599public static Tensor<T> AcosPi<T>(in ReadOnlyTensorSpan<T> x) 2602Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 2623/// Takes the inverse sin of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 2626public static Tensor<T> Asin<T>(in ReadOnlyTensorSpan<T> x) 2629Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 2650/// 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. 2653public static Tensor<T> Asinh<T>(in ReadOnlyTensorSpan<T> x) 2656Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 2677/// 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. 2680public static Tensor<T> AsinPi<T>(in ReadOnlyTensorSpan<T> x) 2683Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 2704/// Takes the arc tangent of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 2707public static Tensor<T> Atan<T>(in ReadOnlyTensorSpan<T> x) 2710Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 2731/// Takes the arc tangent of the two input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 2735public static Tensor<T> Atan2<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 2738Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 2758/// Takes the arc tangent of the two input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 2762public static Tensor<T> Atan2<T>(in ReadOnlyTensorSpan<T> x, T y) 2765Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 2785/// Takes the arc tangent of the two input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 2789public static Tensor<T> Atan2<T>(T x, in ReadOnlyTensorSpan<T> y) 2792Tensor<T> destination = CreateFromShapeUninitialized<T>(y.Lengths); 2814/// 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. 2818public static Tensor<T> Atan2Pi<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 2821Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 2845public static Tensor<T> Atan2Pi<T>(in ReadOnlyTensorSpan<T> x, T y) 2848Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 2872public static Tensor<T> Atan2Pi<T>(T x, in ReadOnlyTensorSpan<T> y) 2875Tensor<T> destination = CreateFromShapeUninitialized<T>(y.Lengths); 2897/// 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. 2900public static Tensor<T> Atanh<T>(in ReadOnlyTensorSpan<T> x) 2903Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 2924/// 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. 2927public static Tensor<T> AtanPi<T>(in ReadOnlyTensorSpan<T> x) 2930Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 2968/// Computes the element-wise cube root of the input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 2971public static Tensor<T> Cbrt<T>(in ReadOnlyTensorSpan<T> x) 2974Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 2995/// Computes the element-wise ceiling of the input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 2998public static Tensor<T> Ceiling<T>(in ReadOnlyTensorSpan<T> x) 3001Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 3026public static Tensor<TTo> ConvertChecked<TFrom, TTo>(in ReadOnlyTensorSpan<TFrom> source) 3030Tensor<TTo> destination = CreateFromShapeUninitialized<TTo>(source.Lengths); 3057public static Tensor<TTo> ConvertSaturating<TFrom, TTo>(in ReadOnlyTensorSpan<TFrom> source) 3061Tensor<TTo> destination = CreateFromShapeUninitialized<TTo>(source.Lengths); 3088public static Tensor<TTo> ConvertTruncating<TFrom, TTo>(in ReadOnlyTensorSpan<TFrom> source) 3092Tensor<TTo> destination = CreateFromShapeUninitialized<TTo>(source.Lengths); 3119public static Tensor<T> CopySign<T>(in ReadOnlyTensorSpan<T> x, T sign) 3122Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 3128/// 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. 3132public static Tensor<T> CopySign<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> sign) 3135Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 3171/// Takes the cosine of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 3174public static Tensor<T> Cos<T>(in ReadOnlyTensorSpan<T> x) 3177Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 3198/// Takes the hyperbolic cosine of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 3201public static Tensor<T> Cosh<T>(in ReadOnlyTensorSpan<T> x) 3204Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 3240/// <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> 3254public static Tensor<T> CosPi<T>(in ReadOnlyTensorSpan<T> x) 3257Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 3291public static Tensor<T> DegreesToRadians<T>(in ReadOnlyTensorSpan<T> x) 3294Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 3350public static Tensor<T> Exp<T>(in ReadOnlyTensorSpan<T> x) 3353Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 3377public static Tensor<T> Exp10<T>(in ReadOnlyTensorSpan<T> x) 3380Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 3402public static Tensor<T> Exp10M1<T>(in ReadOnlyTensorSpan<T> x) 3405Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 3425public static Tensor<T> Exp2<T>(in ReadOnlyTensorSpan<T> x) 3428Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 3448public static Tensor<T> Exp2M1<T>(in ReadOnlyTensorSpan<T> x) 3451Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 3471public static Tensor<T> ExpM1<T>(in ReadOnlyTensorSpan<T> x) 3474Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 3494public static Tensor<T> Floor<T>(in ReadOnlyTensorSpan<T> x) 3497Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 3521public static Tensor<T> Hypot<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 3524TensorOperation.ValidateCompatibility(x, y, out Tensor<T> destination); 3550public static Tensor<T> Ieee754Remainder<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 3553TensorOperation.ValidateCompatibility(x, y, out Tensor<T> destination); 3574public static Tensor<T> Ieee754Remainder<T>(in ReadOnlyTensorSpan<T> x, T y) 3577Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 3597public static Tensor<T> Ieee754Remainder<T>(T x, in ReadOnlyTensorSpan<T> y) 3600Tensor<T> destination = CreateFromShapeUninitialized<T>(y.Lengths); 3621public static Tensor<int> ILogB<T>(in ReadOnlyTensorSpan<T> x) 3624Tensor<int> destination = CreateFromShapeUninitialized<int>(x.Lengths); 3773public static Tensor<T> LeadingZeroCount<T>(in ReadOnlyTensorSpan<T> x) 3776Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 3797/// Takes the natural logarithm of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 3800public static Tensor<T> Log<T>(in ReadOnlyTensorSpan<T> x) 3803Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 3824public static Tensor<T> Log<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 3827TensorOperation.ValidateCompatibility(x, y, out Tensor<T> destination); 3847public static Tensor<T> Log<T>(in ReadOnlyTensorSpan<T> x, T y) 3850Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 3870/// 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. 3873public static Tensor<T> Log10<T>(in ReadOnlyTensorSpan<T> x) 3876Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 3897/// 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. 3900public static Tensor<T> Log10P1<T>(in ReadOnlyTensorSpan<T> x) 3903Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 3924/// 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. 3927public static Tensor<T> Log2<T>(in ReadOnlyTensorSpan<T> x) 3930Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 3951/// 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. 3954public static Tensor<T> Log2P1<T>(in ReadOnlyTensorSpan<T> x) 3957Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 3978/// 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. 3981public static Tensor<T> LogP1<T>(in ReadOnlyTensorSpan<T> x) 3984Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 4022public static Tensor<T> Max<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 4025TensorOperation.ValidateCompatibility(in x, in y, out Tensor<T> output); 4045public static Tensor<T> Max<T>(in ReadOnlyTensorSpan<T> x, T y) 4048Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 4085public static Tensor<T> MaxMagnitude<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 4088TensorOperation.ValidateCompatibility(in x, in y, out Tensor<T> destination); 4108public static Tensor<T> MaxMagnitude<T>(in ReadOnlyTensorSpan<T> x, T y) 4111Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 4148public static Tensor<T> MaxMagnitudeNumber<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 4151TensorOperation.ValidateCompatibility(in x, in y, out Tensor<T> destination); 4171public static Tensor<T> MaxMagnitudeNumber<T>(in ReadOnlyTensorSpan<T> x, T y) 4174Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 4211public static Tensor<T> MaxNumber<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 4214TensorOperation.ValidateCompatibility(in x, in y, out Tensor<T> destination); 4234public static Tensor<T> MaxNumber<T>(in ReadOnlyTensorSpan<T> x, T y) 4237Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 4274public static Tensor<T> Min<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 4277TensorOperation.ValidateCompatibility(in x, in y, out Tensor<T> output); 4297public static Tensor<T> Min<T>(in ReadOnlyTensorSpan<T> x, T y) 4300Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 4337public static Tensor<T> MinMagnitude<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 4340TensorOperation.ValidateCompatibility(in x, in y, out Tensor<T> destination); 4360public static Tensor<T> MinMagnitude<T>(in ReadOnlyTensorSpan<T> x, T y) 4363Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 4400public static Tensor<T> MinMagnitudeNumber<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 4403TensorOperation.ValidateCompatibility(in x, in y, out Tensor<T> destination); 4423public static Tensor<T> MinMagnitudeNumber<T>(in ReadOnlyTensorSpan<T> x, T y) 4426Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 4463public static Tensor<T> MinNumber<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 4466TensorOperation.ValidateCompatibility(in x, in y, out Tensor<T> destination); 4486public static Tensor<T> MinNumber<T>(in ReadOnlyTensorSpan<T> x, T y) 4489Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 4524public static Tensor<T> PopCount<T>(in ReadOnlyTensorSpan<T> x) 4527Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 4548public static Tensor<T> Pow<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 4551TensorOperation.ValidateCompatibility(x, y, out Tensor<T> destination); 4571public static Tensor<T> Pow<T>(in ReadOnlyTensorSpan<T> x, T y) 4574Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 4594public static Tensor<T> Pow<T>(T x, in ReadOnlyTensorSpan<T> y) 4597Tensor<T> destination = CreateFromShapeUninitialized<T>(y.Lengths); 4630public static Tensor<T> RadiansToDegrees<T>(in ReadOnlyTensorSpan<T> x) 4633Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 4653public static Tensor<T> Reciprocal<T>(in ReadOnlyTensorSpan<T> x) 4656Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 4677public static Tensor<T> RootN<T>(in ReadOnlyTensorSpan<T> x, int n) 4680Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 4703public static Tensor<T> RotateLeft<T>(in ReadOnlyTensorSpan<T> x, int rotateAmount) 4706Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 4730public static Tensor<T> RotateRight<T>(in ReadOnlyTensorSpan<T> x, int rotateAmount) 4733Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 4755public static Tensor<T> Round<T>(in ReadOnlyTensorSpan<T> x) 4758Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 4778public static Tensor<T> Round<T>(in ReadOnlyTensorSpan<T> x, int digits, MidpointRounding mode) 4781Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 4802public static Tensor<T> Round<T>(in ReadOnlyTensorSpan<T> x, int digits) 4805Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 4825public static Tensor<T> Round<T>(in ReadOnlyTensorSpan<T> x, MidpointRounding mode) 4828Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 4849public static Tensor<T> Sigmoid<T>(in ReadOnlyTensorSpan<T> x) 4852Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 4871/// Takes the sin of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 4874public static Tensor<T> Sin<T>(in ReadOnlyTensorSpan<T> x) 4877Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 4899public static Tensor<T> Sinh<T>(in ReadOnlyTensorSpan<T> x) 4902Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 4922public static Tensor<T> SinPi<T>(in ReadOnlyTensorSpan<T> x) 4925Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 4945public static Tensor<T> SoftMax<T>(in ReadOnlyTensorSpan<T> x) 4951Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 4973/// Takes the square root of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 4976public static Tensor<T> Sqrt<T>(in ReadOnlyTensorSpan<T> x) 4979Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 5048public static Tensor<T> Tan<T>(in ReadOnlyTensorSpan<T> x) 5051Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 5071public static Tensor<T> Tanh<T>(in ReadOnlyTensorSpan<T> x) 5074Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 5094public static Tensor<T> TanPi<T>(in ReadOnlyTensorSpan<T> x) 5097Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 5117public static Tensor<T> TrailingZeroCount<T>(in ReadOnlyTensorSpan<T> x) 5120Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 5140public static Tensor<T> Truncate<T>(in ReadOnlyTensorSpan<T> x) 5143Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
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_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_1.cs (27)
18public sealed class Tensor<T> : ITensor<Tensor<T>, T>, IEnumerable<T> 21public static Tensor<T> Empty { get; } = new(); 93public Tensor<T> this[params ReadOnlySpan<NRange> ranges] 126public static implicit operator Tensor<T>(T[] array) => Tensor.Create(array); 131public static implicit operator TensorSpan<T>(Tensor<T> tensor) => tensor.AsTensorSpan(); 134public static implicit operator ReadOnlyTensorSpan<T>(Tensor<T> tensor) => tensor.AsReadOnlyTensorSpan(); 215public Tensor<T> Slice(params ReadOnlySpan<nint> startIndexes) 230public Tensor<T> Slice(params ReadOnlySpan<NIndex> startIndexes) 245public Tensor<T> Slice(params ReadOnlySpan<NRange> ranges) 260public Tensor<T> ToDenseTensor() 262Tensor<T> result = this; 321ref readonly T IReadOnlyTensor<Tensor<T>, T>.this[params ReadOnlySpan<nint> indexes] => ref this[indexes]; 323ref readonly T IReadOnlyTensor<Tensor<T>, T>.this[params ReadOnlySpan<NIndex> indexes] => ref this[indexes]; 325ReadOnlyTensorDimensionSpan<T> IReadOnlyTensor<Tensor<T>, T>.GetDimensionSpan(int dimension) => AsReadOnlyTensorSpan().GetDimensionSpan(dimension); 327ref readonly T IReadOnlyTensor<Tensor<T>, T>.GetPinnableReference() => ref GetPinnableReference(); 329ReadOnlySpan<T> IReadOnlyTensor<Tensor<T>, T>.GetSpan(scoped ReadOnlySpan<nint> startIndexes, int length) => AsReadOnlyTensorSpan().GetSpan(startIndexes, length); 331ReadOnlySpan<T> IReadOnlyTensor<Tensor<T>, T>.GetSpan(scoped ReadOnlySpan<NIndex> startIndexes, int length) => AsReadOnlyTensorSpan().GetSpan(startIndexes, length); 365static Tensor<T> ITensor<Tensor<T>, T>.CreateFromShape(scoped ReadOnlySpan<nint> lengths, bool pinned) => Tensor.CreateFromShape<T>(lengths, pinned); 367static Tensor<T> ITensor<Tensor<T>, T>.CreateFromShape(scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides, bool pinned) => Tensor.CreateFromShape<T>(lengths, strides, pinned); 369static Tensor<T> ITensor<Tensor<T>, T>.CreateFromShapeUninitialized(scoped ReadOnlySpan<nint> lengths, bool pinned) => Tensor.CreateFromShapeUninitialized<T>(lengths, pinned); 371static Tensor<T> ITensor<Tensor<T>, T>.CreateFromShapeUninitialized(scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides, bool pinned) => Tensor.CreateFromShapeUninitialized<T>(lengths, strides, pinned); 376private readonly Tensor<T> _tensor; 381internal Enumerator(Tensor<T> tensor)
System\Numerics\Tensors\netcore\TensorOperation.cs (1)
359public 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>