10 instantiations of Tensor
System.Numerics.Tensors (10)
System\Numerics\Tensors\netcore\Tensor.cs (2)
143public static Tensor<T> Empty { get; } = new(); 466var outTensor = new Tensor<T>(values, s.Lengths.ToArray(), _isPinned);
System\Numerics\Tensors\netcore\TensorExtensions.cs (8)
221return new Tensor<T>(input._values, lengths, false); 247Tensor<T> output = new Tensor<T>(input._values, lengths, strides); 2663outTensor = new Tensor<T>(values, lengths, Array.Empty<nint>(), tensor._isPinned); 2774return new Tensor<T>(tensor._values, arrLengths, strides); 2929Tensor<T> output = new Tensor<T>(values, lengths, false); 3220outputs[i] = new Tensor<T>(values, newShape); 3302return new Tensor<T>(tensor._values, lengths, strides); 3664return new Tensor<T>(tensor._values, lengths, strides);
533 references to Tensor
System.Numerics.Tensors (533)
System\Numerics\Tensors\netcore\Tensor.cs (63)
25: ITensor<Tensor<T>, T> 90/// Creates a <see cref="Tensor{T}"/> and initializes it with the default value of T. If <paramref name="pinned"/> is true, the memory will be pinned. 94static Tensor<T> ITensor<Tensor<T>, T>.Create(scoped ReadOnlySpan<nint> lengths, bool pinned) 102/// Creates a <see cref="Tensor{T}"/> and initializes it with the default value of T. If <paramref name="pinned"/> is true, the memory will be pinned. 107static Tensor<T> ITensor<Tensor<T>, T>.Create(scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides, bool pinned) 115/// Creates a <see cref="Tensor{T}"/> and does not initialize it. If <paramref name="pinned"/> is true, the memory will be pinned. 119static Tensor<T> ITensor<Tensor<T>, T>.CreateUninitialized(scoped ReadOnlySpan<nint> lengths, bool pinned) 127/// Creates a <see cref="Tensor{T}"/> and does not initialize it. If <paramref name="pinned"/> is true, the memory will be pinned. 132static Tensor<T> ITensor<Tensor<T>, T>.CreateUninitialized(scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides, bool pinned) 143public static Tensor<T> Empty { get; } = new(); 146/// Gets a value indicating whether this <see cref="Tensor{T}"/> is empty. 152/// Gets a value indicating whether the backing memory of the <see cref="Tensor{T}"/> is pinned."/> 158/// Gets a value indicating the rank, or number of dimensions, of this <see cref="Tensor{T}"/>. 164/// The number of items in the <see cref="Tensor{T}"/>. 170/// Gets the length of each dimension in this <see cref="Tensor{T}"/>. 176/// Gets the length of each dimension in this <see cref="Tensor{T}"/>. 179ReadOnlySpan<nint> IReadOnlyTensor<Tensor<T>, T>.Lengths => _lengths; 183/// Gets the strides of each dimension in this <see cref="Tensor{T}"/>. 189/// Gets the strides of each dimension in this <see cref="Tensor{T}"/>. 192ReadOnlySpan<nint> IReadOnlyTensor<Tensor<T>, T>.Strides => _strides; 194bool ITensor<Tensor<T>, T>.IsReadOnly => false; 224public Tensor<T> this[params ReadOnlySpan<NRange> ranges] 260T ITensor<Tensor<T>, T>.this[params ReadOnlySpan<nint> indexes] 280T ITensor<Tensor<T>, T>.this[params ReadOnlySpan<NIndex> indexes] 300T IReadOnlyTensor<Tensor<T>, T>.this[params ReadOnlySpan<nint> indexes] => AsReadOnlyTensorSpan()[indexes]; 310T IReadOnlyTensor<Tensor<T>, T>.this[params ReadOnlySpan<NIndex> indexes] => AsReadOnlyTensorSpan()[indexes]; 320Tensor<T> IReadOnlyTensor<Tensor<T>, T>.this[params ReadOnlySpan<NRange> ranges] 338public Tensor<T> this[Tensor<bool> filter] 371/// Defines an implicit conversion of an array to a <see cref="Tensor{T}"/>. 373public static implicit operator Tensor<T>(T[] array) => new Tensor<T>(array, [array.Length]); 376/// Defines an implicit conversion of a <see cref="Tensor{T}"/> to a <see cref="TensorSpan{T}"/>. 378public static implicit operator TensorSpan<T>(Tensor<T> value) => new TensorSpan<T>(ref MemoryMarshal.GetArrayDataReference(value._values), value._lengths, value._strides, value._flattenedLength); 381/// Defines an implicit conversion of a <see cref="Tensor{T}"/> to a <see cref="TensorSpan{T}"/>. 383public static implicit operator ReadOnlyTensorSpan<T>(Tensor<T> value) => new ReadOnlyTensorSpan<T>(ref MemoryMarshal.GetArrayDataReference(value._values), value._lengths, value._strides, value.FlattenedLength); 386/// Converts this <see cref="Tensor{T}"/> to a <see cref="TensorSpan{T}"/> pointing to the same backing memory."/> 392/// Converts this <see cref="Tensor{T}"/> to a <see cref="TensorSpan{T}"/> pointing to the same backing memory based on the provided ranges."/> 399/// Converts this <see cref="Tensor{T}"/> to a <see cref="TensorSpan{T}"/> pointing to the same backing memory based on the provided start locations."/> 406/// Converts this <see cref="Tensor{T}"/> to a <see cref="TensorSpan{T}"/> pointing to the same backing memory based on the provided start indexes."/> 413/// Converts this <see cref="Tensor{T}"/> to a <see cref="ReadOnlyTensorSpan{T}"/> pointing to the same backing memory."/> 419/// Converts this <see cref="Tensor{T}"/> to a <see cref="ReadOnlyTensorSpan{T}"/> pointing to the same backing memory based on the provided ranges."/> 426/// Converts this <see cref="Tensor{T}"/> to a <see cref="ReadOnlyTensorSpan{T}"/> pointing to the same backing memory based on the provided start locations."/> 433/// Converts this <see cref="Tensor{T}"/> to a <see cref="ReadOnlyTensorSpan{T}"/> pointing to the same backing memory based on the provided start indexes."/> 451ref readonly T IReadOnlyTensor<Tensor<T>, T>.GetPinnableReference() => ref AsReadOnlyTensorSpan().GetPinnableReference(); 457/// <returns><see cref="Tensor{T}"/> as a copy of the provided ranges.</returns> 459public Tensor<T> Slice(params ReadOnlySpan<NRange> start) 466var outTensor = new Tensor<T>(values, s.Lengths.ToArray(), _isPinned); 475/// <returns><see cref="Tensor{T}"/> as a copy of the provided ranges.</returns> 477public Tensor<T> Slice(params ReadOnlySpan<nint> start) 491/// <returns><see cref="Tensor{T}"/> as a copy of the provided ranges.</returns> 493public Tensor<T> Slice(params ReadOnlySpan<NIndex> startIndex) 551/// Gets an <see cref="IEnumerator{T}"/> for the <see cref="Tensor{T}"/>. 558/// Gets an <see cref="IEnumerator{T}"/> for the <see cref="Tensor{T}"/>. 564/// Gets an <see cref="IEnumerator"/> for the <see cref="Tensor{T}"/>."/> 572private readonly Tensor<T> _tensor; 582internal Enumerator(Tensor<T> tensor) 629/// Gets the hash code for the <see cref="Tensor{T}"/>. 659/// <returns>A <see cref="string"/> representation of the <see cref="Tensor{T}"/></returns>
System\Numerics\Tensors\netcore\Tensor.Factory.cs (24)
21/// Creates a <see cref="Tensor{T}"/> and initializes it with the default value of T. If <paramref name="pinned"/> is true, the memory will be pinned. 25public static Tensor<T> Create<T>(scoped ReadOnlySpan<nint> lengths, bool pinned = false) 33/// Creates a <see cref="Tensor{T}"/> and initializes it with the default value of T. If <paramref name="pinned"/> is true, the memory will be pinned. 38public static Tensor<T> Create<T>(scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides, bool pinned = false) 46/// Creates a <see cref="Tensor{T}"/> from the provided <paramref name="values"/>. If the product of the 53public static Tensor<T> Create<T>(T[] values, scoped ReadOnlySpan<nint> lengths, bool pinned = false) 57/// Creates a <see cref="Tensor{T}"/> from the provided <paramref name="values"/>. If the product of the 65public static Tensor<T> Create<T>(T[] values, scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides, bool pinned = false) 71/// Creates a <see cref="Tensor{T}"/> and initializes it with the data from <paramref name="values"/>. 77public static Tensor<T> Create<T>(IEnumerable<T> values, scoped ReadOnlySpan<nint> lengths, bool pinned = false) 84/// Creates a <see cref="Tensor{T}"/> and initializes it with the data from <paramref name="values"/>. 90public static Tensor<T> Create<T>(IEnumerable<T> values, scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides, bool pinned = false) 98/// Creates a <see cref="Tensor{T}"/> and initializes it with random data in a gaussian normal distribution. 101public static Tensor<T> CreateAndFillGaussianNormalDistribution<T>(params scoped ReadOnlySpan<nint> lengths) 108/// Creates a <see cref="Tensor{T}"/> and initializes it with random data in a gaussian normal distribution. 112public static Tensor<T> CreateAndFillGaussianNormalDistribution<T>(Random random, params scoped ReadOnlySpan<nint> lengths) 135/// Creates a <see cref="Tensor{T}"/> and initializes it with random data uniformly distributed. 138public static Tensor<T> CreateAndFillUniformDistribution<T>(params scoped ReadOnlySpan<nint> lengths) 145/// Creates a <see cref="Tensor{T}"/> and initializes it with random data uniformly distributed. 149public static Tensor<T> CreateAndFillUniformDistribution<T>(Random random, params scoped ReadOnlySpan<nint> lengths) 161/// Creates a <see cref="Tensor{T}"/> and does not initialize it. If <paramref name="pinned"/> is true, the memory will be pinned. 165public static Tensor<T> CreateUninitialized<T>(scoped ReadOnlySpan<nint> lengths, bool pinned = false) 169/// Creates a <see cref="Tensor{T}"/> and does not initialize it. If <paramref name="pinned"/> is true, the memory will be pinned. 174public static Tensor<T> CreateUninitialized<T>(scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides, bool pinned = false)
System\Numerics\Tensors\netcore\TensorExtensions.cs (442)
50/// 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. 52/// <param name="source">Input <see cref="Tensor{T}"/>.</param> 53/// <param name="lengthsSource">Other <see cref="Tensor{T}"/> to make shapes broadcastable.</param> 54public static Tensor<T> Broadcast<T>(scoped in ReadOnlyTensorSpan<T> source, scoped in ReadOnlyTensorSpan<T> lengthsSource) 60/// 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. 63/// <param name="source">Input <see cref="Tensor{T}"/>.</param> 66public static Tensor<T> Broadcast<T>(scoped in ReadOnlyTensorSpan<T> source, scoped ReadOnlySpan<nint> lengths) 71Tensor<T> output = Tensor.CreateUninitialized<T>(intermediate.Lengths); 83public static void BroadcastTo<T>(this Tensor<T> source, in TensorSpan<T> destination) 125/// Broadcast the data from <paramref name="input"/> to the new shape <paramref name="shape"/>. Creates a new <see cref="Tensor{T}"/> 168/// Broadcast the data from <paramref name="input"/> to the new shape <paramref name="shape"/>. Creates a new <see cref="Tensor{T}"/> 211/// Broadcast the data from <paramref name="input"/> to the new shape <paramref name="lengths"/>. Creates a new <see cref="Tensor{T}"/> 215/// <param name="input">Input <see cref="Tensor{T}"/>.</param> 218internal static Tensor<T> LazyBroadcast<T>(Tensor<T> input, ReadOnlySpan<nint> lengths) 247Tensor<T> output = new Tensor<T>(input._values, lengths, strides); 258public static Tensor<T> Concatenate<T>(params scoped ReadOnlySpan<Tensor<T>> tensors) 268public static Tensor<T> ConcatenateOnDimension<T>(int dimension, params scoped ReadOnlySpan<Tensor<T>> tensors) 302Tensor<T> tensor; 324public static ref readonly TensorSpan<T> Concatenate<T>(scoped ReadOnlySpan<Tensor<T>> tensors, in TensorSpan<T> destination) 336public static ref readonly TensorSpan<T> ConcatenateOnDimension<T>(int dimension, scoped ReadOnlySpan<Tensor<T>> tensors, in TensorSpan<T> destination) 439public static Tensor<bool> Equals<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 442Tensor<bool> result; 520public static Tensor<bool> Equals<T>(in ReadOnlyTensorSpan<T> x, T y) 523Tensor<bool> result = Tensor.Create<bool>(x.Lengths, false); 743/// <param name="tensor">Input <see cref="Tensor{T}"/>.</param> 769/// <param name="tensor">Input <see cref="Tensor{T}"/>.</param> 800/// 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"/> 805/// <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 807public static Tensor<bool> GreaterThan<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 810Tensor<bool> result; 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>A <see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/> and 886/// 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"/> 891/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/> 893public static Tensor<bool> GreaterThan<T>(in ReadOnlyTensorSpan<T> x, T y) 896Tensor<bool> result = Tensor.Create<bool>(x.Lengths, false); 903/// It returns a <see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/> 909/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/> 946/// 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"/> 951/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/> 953public static Tensor<bool> GreaterThan<T>(T x, in ReadOnlyTensorSpan<T> y) 956Tensor<bool> result = Tensor.Create<bool>(y.Lengths, false); 963/// 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"/> 969/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater 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 greater than <paramref name="y"/> 1014/// <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 1016public static Tensor<bool> GreaterThanOrEqual<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 1019Tensor<bool> result; 1037/// 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"/> 1043/// <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 1095/// 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"/> 1100/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/> 1102public static Tensor<bool> GreaterThanOrEqual<T>(in ReadOnlyTensorSpan<T> x, T y) 1105Tensor<bool> result = Tensor.Create<bool>(x.Lengths, false); 1112/// 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"/> 1118/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/> 1155/// 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"/> 1160/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/> 1162public static Tensor<bool> GreaterThanOrEqual<T>(T x, in ReadOnlyTensorSpan<T> y) 1165Tensor<bool> result = Tensor.Create<bool>(y.Lengths, false); 1172/// 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"/> 1178/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/> 1712/// 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"/> 1717/// <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 1719public static Tensor<bool> LessThan<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 1722Tensor<bool> result; 1740/// 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"/> 1746/// <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 1797/// Compares the elements of a <see cref="Tensor{T}"/> to see which elements are less than <paramref name="y"/>. 1798/// 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"/> 1801/// <param name="x"><see cref="Tensor{T}"/> to compare.</param> 1803/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/> 1805public static Tensor<bool> LessThan<T>(in ReadOnlyTensorSpan<T> x, T y) 1808Tensor<bool> result = Tensor.Create<bool>(x.Lengths, false); 1814/// Compares the elements of a <see cref="Tensor{T}"/> to see which elements are less than <paramref name="y"/>. 1815/// 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"/> 1818/// <param name="x"><see cref="Tensor{T}"/> to compare.</param> 1821/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/> 1857/// Compares the elements of a <see cref="Tensor{T}"/> to see which elements are less than <paramref name="y"/>. 1858/// 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"/> 1861/// <param name="x"><see cref="Tensor{T}"/> to compare.</param> 1863/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/> 1865public static Tensor<bool> LessThan<T>(T x, in ReadOnlyTensorSpan<T> y) 1868Tensor<bool> result = Tensor.Create<bool>(y.Lengths, false); 1874/// Compares the elements of a <see cref="Tensor{T}"/> to see which elements are less than <paramref name="y"/>. 1875/// 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"/> 1878/// <param name="x"><see cref="Tensor{T}"/> to compare.</param> 1881/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/> 1921/// 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"/> 1926/// <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 1928public static Tensor<bool> LessThanOrEqual<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 1931Tensor<bool> result; 1949/// 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"/> 1955/// <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 2006/// Compares the elements of a <see cref="Tensor{T}"/> to see which elements are less than <paramref name="y"/>. 2007/// 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"/> 2010/// <param name="x"><see cref="Tensor{T}"/> to compare.</param> 2012/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/> 2014public static Tensor<bool> LessThanOrEqual<T>(in ReadOnlyTensorSpan<T> x, T y) 2017Tensor<bool> result = Tensor.Create<bool>(x.Lengths, false); 2023/// Compares the elements of a <see cref="Tensor{T}"/> to see which elements are less than <paramref name="y"/>. 2024/// 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"/> 2027/// <param name="x"><see cref="Tensor{T}"/> to compare.</param> 2030/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/> 2066/// Compares the elements of a <see cref="Tensor{T}"/> to see which elements are less than <paramref name="y"/>. 2067/// 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"/> 2070/// <param name="x"><see cref="Tensor{T}"/> to compare.</param> 2072/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/> 2074public static Tensor<bool> LessThanOrEqual<T>(T x, in ReadOnlyTensorSpan<T> y) 2077Tensor<bool> result = Tensor.Create<bool>(y.Lengths, false); 2083/// Compares the elements of a <see cref="Tensor{T}"/> to see which elements are less than <paramref name="y"/>. 2084/// 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"/> 2087/// <param name="x"><see cref="Tensor{T}"/> to compare.</param> 2090/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/> 2624/// If <paramref name="tensor"/> is a 1D tensor, it will return <paramref name="tensor"/>. Otherwise it creates a new <see cref="Tensor{T}"/> 2627/// <param name="tensor">Input <see cref="Tensor{T}"/></param> 2629public static Tensor<T> PermuteDimensions<T>(this Tensor<T> tensor, params ReadOnlySpan<int> dimensions) 2639Tensor<T> outTensor; 2714/// <param name="tensor"><see cref="Tensor{T}"/> you want to reshape.</param> 2716public static Tensor<T> Reshape<T>(this Tensor<T> tensor, params ReadOnlySpan<nint> lengths) 2920/// 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 2923/// <param name="tensor">Input <see cref="Tensor{T}"/>.</param> 2925public static Tensor<T> Resize<T>(Tensor<T> tensor, ReadOnlySpan<nint> lengths) 2929Tensor<T> output = new Tensor<T>(values, lengths, false); 2944/// <param name="tensor">Input <see cref="Tensor{T}"/>.</param> 2946public static void ResizeTo<T>(scoped in Tensor<T> tensor, in TensorSpan<T> destination) 2993/// <param name="tensor">Input <see cref="Tensor{T}"/>.</param> 2994public static Tensor<T> Reverse<T>(in ReadOnlyTensorSpan<T> tensor) 2996Tensor<T> output = Tensor.Create<T>(tensor.Lengths); 3006/// <param name="tensor">Input <see cref="Tensor{T}"/>.</param> 3008public static Tensor<T> ReverseDimension<T>(in ReadOnlyTensorSpan<T> tensor, int dimension) 3010Tensor<T> output = Tensor.Create<T>(tensor.Lengths); 3130/// <param name="tensor">Input <see cref="Tensor{T}"/>.</param> 3133public static Tensor<T> SetSlice<T>(this Tensor<T> tensor, in ReadOnlyTensorSpan<T> values, params ReadOnlySpan<NRange> ranges) 3143/// <param name="tensor">Input <see cref="Tensor{T}"/>.</param> 3172/// Split a <see cref="Tensor{T}"/> into <paramref name="splitCount"/> along the given <paramref name="dimension"/>. If the tensor cannot be split 3175/// <param name="tensor">Input <see cref="Tensor{T}"/>.</param> 3178public static Tensor<T>[] Split<T>(scoped in ReadOnlyTensorSpan<T> tensor, int splitCount, nint dimension) 3183Tensor<T>[] outputs = new Tensor<T>[splitCount]; 3252/// <param name="tensor">The <see cref="Tensor{T}"/> to remove all dimensions of length 1.</param> 3253public static Tensor<T> Squeeze<T>(this Tensor<T> tensor) 3262/// <param name="tensor">The <see cref="Tensor{T}"/> to remove dimension of length 1.</param> 3264public static Tensor<T> SqueezeDimension<T>(this Tensor<T> tensor, int dimension) 3420/// Join multiple <see cref="Tensor{T}"/> along a new dimension that is added at position 0. All tensors must have the same shape. 3422/// <param name="tensors">Input <see cref="Tensor{T}"/>.</param> 3423public static Tensor<T> Stack<T>(params ReadOnlySpan<Tensor<T>> tensors) 3429/// 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. 3431/// <param name="tensors">Input <see cref="Tensor{T}"/>.</param> 3433public static Tensor<T> StackAlongDimension<T>(int dimension, params ReadOnlySpan<Tensor<T>> tensors) 3447Tensor<T>[] outputs = new Tensor<T>[tensors.Length]; 3456/// Join multiple <see cref="Tensor{T}"/> along a new dimension that is added at position 0. All tensors must have the same shape. 3458/// <param name="tensors">Input <see cref="Tensor{T}"/>.</param> 3460public static ref readonly TensorSpan<T> Stack<T>(scoped in ReadOnlySpan<Tensor<T>> tensors, in TensorSpan<T> destination) 3466/// 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. 3468/// <param name="tensors">Input <see cref="Tensor{T}"/>.</param> 3471public static ref readonly TensorSpan<T> StackAlongDimension<T>(scoped ReadOnlySpan<Tensor<T>> tensors, in TensorSpan<T> destination, int dimension) 3485Tensor<T>[] outputs = new Tensor<T>[tensors.Length]; 3556/// Creates a <see cref="string"/> representation of the <see cref="Tensor{T}"/>."/> 3561public static string ToString<T>(this Tensor<T> tensor, params ReadOnlySpan<nint> maximumLengths) => ((ReadOnlyTensorSpan<T>)tensor).ToString(maximumLengths); 3569/// <param name="tensor">Input <see cref="Tensor{T}"/>.</param> 3570public static Tensor<T> Transpose<T>(Tensor<T> tensor) 3591/// <param name="tensor">Input <see cref="Tensor{T}"/>.</param> 3593public static bool TryBroadcastTo<T>(this Tensor<T> tensor, in TensorSpan<T> destination) 3633/// <param name="tensor">The <see cref="Tensor{T}"/> to add a dimension of length 1.</param> 3635public static Tensor<T> Unsqueeze<T>(this Tensor<T> tensor, int dimension) 3745/// Takes the absolute value of each element of the <see cref="Tensor{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 3748public static Tensor<T> Abs<T>(in ReadOnlyTensorSpan<T> x) 3751Tensor<T> output = Tensor.Create<T>(x.Lengths); 3770/// Takes the inverse cosine of each element of the <see cref="Tensor{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 3773public static Tensor<T> Acos<T>(in ReadOnlyTensorSpan<T> x) 3776Tensor<T> output = Tensor.Create<T>(x.Lengths); 3782/// Takes the inverse cosine of each element of the <see cref="Tensor{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 3795/// 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. 3798public static Tensor<T> Acosh<T>(in ReadOnlyTensorSpan<T> x) 3801Tensor<T> output = Tensor.Create<T>(x.Lengths); 3820/// 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. 3823public static Tensor<T> AcosPi<T>(in ReadOnlyTensorSpan<T> x) 3826Tensor<T> output = Tensor.Create<T>(x.Lengths); 3845/// Adds each element of <paramref name="x"/> to each element of <paramref name="y"/> and returns a new <see cref="Tensor{T}"/> with the result. 3849public static Tensor<T> Add<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 3852Tensor<T> output; 3867/// Adds <paramref name="y"/> to each element of <paramref name="x"/> and returns a new <see cref="Tensor{T}"/> with the result. 3871public static Tensor<T> Add<T>(in ReadOnlyTensorSpan<T> x, T y) 3874Tensor<T> output = Tensor.Create<T>(x.Lengths); 3906/// Takes the inverse sin of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 3909public static Tensor<T> Asin<T>(in ReadOnlyTensorSpan<T> x) 3912Tensor<T> output = Tensor.Create<T>(x.Lengths); 3931/// 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. 3934public static Tensor<T> Asinh<T>(in ReadOnlyTensorSpan<T> x) 3937Tensor<T> output = Tensor.Create<T>(x.Lengths); 3956/// 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. 3959public static Tensor<T> AsinPi<T>(in ReadOnlyTensorSpan<T> x) 3962Tensor<T> output = Tensor.Create<T>(x.Lengths); 3981/// Takes the arc tangent of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 3984public static Tensor<T> Atan<T>(in ReadOnlyTensorSpan<T> x) 3987Tensor<T> output = Tensor.Create<T>(x.Lengths); 4006/// Takes the arc tangent of the two input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 4010public static Tensor<T> Atan2<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 4013Tensor<T> output; 4040/// Takes the arc tangent of the two input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 4044public static Tensor<T> Atan2<T>(in ReadOnlyTensorSpan<T> x, T y) 4047Tensor<T> output = Tensor.Create<T>(x.Lengths); 4066/// Takes the arc tangent of the two input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 4070public static Tensor<T> Atan2<T>(T x, in ReadOnlyTensorSpan<T> y) 4073Tensor<T> output = Tensor.Create<T>(y.Lengths); 4094/// 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. 4098public static Tensor<T> Atan2Pi<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 4101Tensor<T> output; 4132public static Tensor<T> Atan2Pi<T>(in ReadOnlyTensorSpan<T> x, T y) 4135Tensor<T> output = Tensor.Create<T>(x.Lengths); 4158public static Tensor<T> Atan2Pi<T>(T x, in ReadOnlyTensorSpan<T> y) 4161Tensor<T> output = Tensor.Create<T>(y.Lengths); 4183/// 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. 4186public static Tensor<T> Atanh<T>(in ReadOnlyTensorSpan<T> x) 4189Tensor<T> output = Tensor.Create<T>(x.Lengths); 4208/// 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. 4211public static Tensor<T> AtanPi<T>(in ReadOnlyTensorSpan<T> x) 4214Tensor<T> output = Tensor.Create<T>(x.Lengths); 4246/// Computes the element-wise bitwise and of the two input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 4250public static Tensor<T> BitwiseAnd<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 4253Tensor<T> output; 4280/// Computes the element-wise bitwise and of the two input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 4284public static Tensor<T> BitwiseAnd<T>(in ReadOnlyTensorSpan<T> x, T y) 4287Tensor<T> output = Tensor.Create<T>(x.Lengths); 4308/// Computes the element-wise bitwise of of the two input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 4312public static Tensor<T> BitwiseOr<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 4315Tensor<T> output; 4342/// Computes the element-wise bitwise or of the two input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 4346public static Tensor<T> BitwiseOr<T>(in ReadOnlyTensorSpan<T> x, T y) 4349Tensor<T> output = Tensor.Create<T>(x.Lengths); 4370/// Computes the element-wise cube root of the input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 4373public static Tensor<T> Cbrt<T>(in ReadOnlyTensorSpan<T> x) 4376Tensor<T> output = Tensor.Create<T>(x.Lengths); 4395/// Computes the element-wise ceiling of the input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 4398public static Tensor<T> Ceiling<T>(in ReadOnlyTensorSpan<T> x) 4401Tensor<T> output = Tensor.Create<T>(x.Lengths); 4424public static Tensor<TTo> ConvertChecked<TFrom, TTo>(in ReadOnlyTensorSpan<TFrom> source) 4428Tensor<TTo> output = Tensor.Create<TTo>(source.Lengths); 4454public static Tensor<TTo> ConvertSaturating<TFrom, TTo>(in ReadOnlyTensorSpan<TFrom> source) 4458Tensor<TTo> output = Tensor.Create<TTo>(source.Lengths); 4484public static Tensor<TTo> ConvertTruncating<TFrom, TTo>(in ReadOnlyTensorSpan<TFrom> source) 4488Tensor<TTo> output = Tensor.Create<TTo>(source.Lengths); 4514public static Tensor<T> CopySign<T>(in ReadOnlyTensorSpan<T> x, T sign) 4517Tensor<T> output = Create<T>(x.Lengths); 4524/// 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. 4528public static Tensor<T> CopySign<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> sign) 4531Tensor<T> output; 4572/// Takes the cosine of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 4575public static Tensor<T> Cos<T>(in ReadOnlyTensorSpan<T> x) 4578Tensor<T> output = Tensor.Create<T>(x.Lengths); 4597/// Takes the hyperbolic cosine of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 4600public static Tensor<T> Cosh<T>(in ReadOnlyTensorSpan<T> x) 4603Tensor<T> output = Tensor.Create<T>(x.Lengths); 4626public static Tensor<T> CosineSimilarity<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 4643Tensor<T> output = Tensor.Create<T>(values, [dim1, dim2]); 4703/// <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> 4717public static Tensor<T> CosPi<T>(in ReadOnlyTensorSpan<T> x) 4720Tensor<T> output = Tensor.Create<T>(x.Lengths); 4752public static Tensor<T> DegreesToRadians<T>(in ReadOnlyTensorSpan<T> x) 4755Tensor<T> output = Tensor.Create<T>(x.Lengths); 4787/// Divides each element of <paramref name="x"/> by <paramref name="y"/> and returns a new <see cref="Tensor{T}"/> with the result. 4791public static Tensor<T> Divide<T>(in ReadOnlyTensorSpan<T> x, T y) 4794Tensor<T> output = Create<T>(x.Lengths); 4800/// Divides <paramref name="x"/> by each element of <paramref name="y"/> and returns a new <see cref="Tensor{T}"/> with the result."/> 4804public static Tensor<T> Divide<T>(T x, in ReadOnlyTensorSpan<T> y) 4807Tensor<T> output = Tensor.Create<T>(y.Lengths); 4818public static Tensor<T> Divide<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 4821Tensor<T> output; 4891public static Tensor<T> Exp<T>(in ReadOnlyTensorSpan<T> x) 4894Tensor<T> output = Tensor.Create<T>(x.Lengths); 4916public static Tensor<T> Exp10<T>(in ReadOnlyTensorSpan<T> x) 4919Tensor<T> output = Tensor.Create<T>(x.Lengths); 4939public static Tensor<T> Exp10M1<T>(in ReadOnlyTensorSpan<T> x) 4942Tensor<T> output = Tensor.Create<T>(x.Lengths); 4960public static Tensor<T> Exp2<T>(in ReadOnlyTensorSpan<T> x) 4963Tensor<T> output = Tensor.Create<T>(x.Lengths); 4981public static Tensor<T> Exp2M1<T>(in ReadOnlyTensorSpan<T> x) 4984Tensor<T> output = Tensor.Create<T>(x.Lengths); 5002public static Tensor<T> ExpM1<T>(in ReadOnlyTensorSpan<T> x) 5005Tensor<T> output = Tensor.Create<T>(x.Lengths); 5023public static Tensor<T> Floor<T>(in ReadOnlyTensorSpan<T> x) 5026Tensor<T> output = Tensor.Create<T>(x.Lengths); 5048public static Tensor<T> Hypot<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 5051Tensor<T> output; 5084public static Tensor<T> Ieee754Remainder<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 5087Tensor<T> output; 5115public static Tensor<T> Ieee754Remainder<T>(in ReadOnlyTensorSpan<T> x, T y) 5118Tensor<T> output = Tensor.Create<T>(x.Lengths); 5137public static Tensor<T> Ieee754Remainder<T>(T x, in ReadOnlyTensorSpan<T> y) 5140Tensor<T> output = Tensor.Create<T>(y.Lengths); 5160public static Tensor<int> ILogB<T>(in ReadOnlyTensorSpan<T> x) 5163Tensor<int> output = Tensor.Create<int>(x.Lengths, x.Strides); 5229public static Tensor<T> LeadingZeroCount<T>(in ReadOnlyTensorSpan<T> x) 5232Tensor<T> output = Tensor.Create<T>(x.Lengths); 5251/// Takes the natural logarithm of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 5254public static Tensor<T> Log<T>(in ReadOnlyTensorSpan<T> x) 5257Tensor<T> output = Tensor.Create<T>(x.Lengths); 5276public static Tensor<T> Log<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 5279Tensor<T> output; 5306public static Tensor<T> Log<T>(in ReadOnlyTensorSpan<T> x, T y) 5309Tensor<T> output = Tensor.Create<T>(x.Lengths); 5328/// 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. 5331public static Tensor<T> Log10<T>(in ReadOnlyTensorSpan<T> x) 5334Tensor<T> output = Tensor.Create<T>(x.Lengths); 5353/// 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. 5356public static Tensor<T> Log10P1<T>(in ReadOnlyTensorSpan<T> x) 5359Tensor<T> output = Tensor.Create<T>(x.Lengths); 5378/// 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. 5381public static Tensor<T> Log2<T>(in ReadOnlyTensorSpan<T> x) 5384Tensor<T> output = Tensor.Create<T>(x.Lengths); 5403/// 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. 5406public static Tensor<T> Log2P1<T>(in ReadOnlyTensorSpan<T> x) 5409Tensor<T> output = Tensor.Create<T>(x.Lengths); 5428/// 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. 5431public static Tensor<T> LogP1<T>(in ReadOnlyTensorSpan<T> x) 5434Tensor<T> output = Tensor.Create<T>(x.Lengths); 5463public static Tensor<T> Max<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 5466Tensor<T> output; 5493public static Tensor<T> Max<T>(in ReadOnlyTensorSpan<T> x, T y) 5496Tensor<T> output = Tensor.Create<T>(x.Lengths); 5524public static Tensor<T> MaxMagnitude<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 5527Tensor<T> output; 5554public static Tensor<T> MaxMagnitude<T>(in ReadOnlyTensorSpan<T> x, T y) 5557Tensor<T> output = Tensor.Create<T>(x.Lengths); 5585public static Tensor<T> MaxMagnitudeNumber<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 5588Tensor<T> output; 5615public static Tensor<T> MaxMagnitudeNumber<T>(in ReadOnlyTensorSpan<T> x, T y) 5618Tensor<T> output = Tensor.Create<T>(x.Lengths); 5646public static Tensor<T> MaxNumber<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 5649Tensor<T> output; 5676public static Tensor<T> MaxNumber<T>(in ReadOnlyTensorSpan<T> x, T y) 5679Tensor<T> output = Tensor.Create<T>(x.Lengths); 5707public static Tensor<T> Min<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 5710Tensor<T> output; 5737public static Tensor<T> Min<T>(in ReadOnlyTensorSpan<T> x, T y) 5740Tensor<T> output = Tensor.Create<T>(x.Lengths); 5768public static Tensor<T> MinMagnitude<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 5771Tensor<T> output; 5798public static Tensor<T> MinMagnitude<T>(in ReadOnlyTensorSpan<T> x, T y) 5801Tensor<T> output = Tensor.Create<T>(x.Lengths); 5829public static Tensor<T> MinMagnitudeNumber<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 5832Tensor<T> output; 5859public static Tensor<T> MinMagnitudeNumber<T>(in ReadOnlyTensorSpan<T> x, T y) 5862Tensor<T> output = Tensor.Create<T>(x.Lengths); 5890public static Tensor<T> MinNumber<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 5893Tensor<T> output; 5920public static Tensor<T> MinNumber<T>(in ReadOnlyTensorSpan<T> x, T y) 5923Tensor<T> output = Tensor.Create<T>(x.Lengths); 5941/// Multiplies each element of <paramref name="x"/> with <paramref name="y"/> and returns a new <see cref="Tensor{T}"/> with the result. 5945public static Tensor<T> Multiply<T>(in ReadOnlyTensorSpan<T> x, T y) 5948Tensor<T> output = Tensor.Create<T>(x.Lengths); 5954/// Multiplies each element of <paramref name="x"/> with <paramref name="y"/> and returns a new <see cref="Tensor{T}"/> with the result. 5959public static Tensor<T> Multiply<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 5962Tensor<T> output; 6008public static Tensor<T> Negate<T>(in ReadOnlyTensorSpan<T> x) 6011Tensor<T> output = Tensor.Create<T>(x.Lengths); 6041public static Tensor<T> OnesComplement<T>(in ReadOnlyTensorSpan<T> x) 6044Tensor<T> output = Tensor.Create<T>(x.Lengths); 6062public static Tensor<T> PopCount<T>(in ReadOnlyTensorSpan<T> x) 6065Tensor<T> output = Tensor.Create<T>(x.Lengths); 6084public static Tensor<T> Pow<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 6087Tensor<T> output; 6114public static Tensor<T> Pow<T>(in ReadOnlyTensorSpan<T> x, T y) 6117Tensor<T> output = Tensor.Create<T>(x.Lengths); 6136public static Tensor<T> Pow<T>(T x, in ReadOnlyTensorSpan<T> y) 6139Tensor<T> output = Tensor.Create<T>(y.Lengths); 6169public static Tensor<T> RadiansToDegrees<T>(in ReadOnlyTensorSpan<T> x) 6172Tensor<T> output = Tensor.Create<T>(x.Lengths); 6190public static Tensor<T> Reciprocal<T>(in ReadOnlyTensorSpan<T> x) 6193Tensor<T> output = Tensor.Create<T>(x.Lengths); 6212public static Tensor<T> RootN<T>(in ReadOnlyTensorSpan<T> x, int n) 6215Tensor<T> output = Tensor.Create<T>(x.Lengths); 6242public static Tensor<T> RotateLeft<T>(in ReadOnlyTensorSpan<T> x, int rotateAmount) 6245Tensor<T> output = Tensor.Create<T>(x.Lengths); 6273public static Tensor<T> RotateRight<T>(in ReadOnlyTensorSpan<T> x, int rotateAmount) 6276Tensor<T> output = Tensor.Create<T>(x.Lengths); 6302public static Tensor<T> Round<T>(in ReadOnlyTensorSpan<T> x) 6305Tensor<T> output = Tensor.Create<T>(x.Lengths); 6323public static Tensor<T> Round<T>(in ReadOnlyTensorSpan<T> x, int digits, MidpointRounding mode) 6326Tensor<T> output = Tensor.Create<T>(x.Lengths); 6351public static Tensor<T> Round<T>(in ReadOnlyTensorSpan<T> x, int digits) 6354Tensor<T> output = Tensor.Create<T>(x.Lengths); 6378public static Tensor<T> Round<T>(in ReadOnlyTensorSpan<T> x, MidpointRounding mode) 6381Tensor<T> output = Tensor.Create<T>(x.Lengths); 6406public static Tensor<T> Sigmoid<T>(in ReadOnlyTensorSpan<T> x) 6409Tensor<T> output = Tensor.Create<T>(x.Lengths); 6426/// Takes the sin of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 6429public static Tensor<T> Sin<T>(in ReadOnlyTensorSpan<T> x) 6432Tensor<T> output = Tensor.Create<T>(x.Lengths); 6452public static Tensor<T> Sinh<T>(in ReadOnlyTensorSpan<T> x) 6455Tensor<T> output = Tensor.Create<T>(x.Lengths); 6473public static Tensor<T> SinPi<T>(in ReadOnlyTensorSpan<T> x) 6476Tensor<T> output = Tensor.Create<T>(x.Lengths); 6494public static Tensor<T> SoftMax<T>(in ReadOnlyTensorSpan<T> x) 6497Tensor<T> output = Tensor.Create<T>(x.Lengths); 6514/// Takes the square root of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 6517public static Tensor<T> Sqrt<T>(in ReadOnlyTensorSpan<T> x) 6520Tensor<T> output = Tensor.Create<T>(x.Lengths); 6552/// Subtracts <paramref name="y"/> from each element of <paramref name="x"/> and returns a new <see cref="Tensor{T}"/> with the result. 6556public static Tensor<T> Subtract<T>(in ReadOnlyTensorSpan<T> x, T y) 6559Tensor<T> output = Create<T>(x.Lengths); 6565/// Subtracts each element of <paramref name="y"/> from <paramref name="x"/> and returns a new <see cref="Tensor{T}"/> with the result. 6569public static Tensor<T> Subtract<T>(T x, in ReadOnlyTensorSpan<T> y) 6572Tensor<T> output = Create<T>(y.Lengths); 6578/// Subtracts each element of <paramref name="x"/> from <paramref name="y"/> and returns a new <see cref="Tensor{T}"/> with the result. 6582public static Tensor<T> Subtract<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 6585Tensor<T> output; 6665public static Tensor<T> Tan<T>(in ReadOnlyTensorSpan<T> x) 6668Tensor<T> output = Tensor.Create<T>(x.Lengths); 6686public static Tensor<T> Tanh<T>(in ReadOnlyTensorSpan<T> x) 6689Tensor<T> output = Tensor.Create<T>(x.Lengths); 6707public static Tensor<T> TanPi<T>(in ReadOnlyTensorSpan<T> x) 6710Tensor<T> output = Tensor.Create<T>(x.Lengths); 6728public static Tensor<T> TrailingZeroCount<T>(in ReadOnlyTensorSpan<T> x) 6731Tensor<T> output = Tensor.Create<T>(x.Lengths); 6749public static Tensor<T> Truncate<T>(in ReadOnlyTensorSpan<T> x) 6752Tensor<T> output = Tensor.Create<T>(x.Lengths); 6771public static Tensor<T> Xor<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 6774Tensor<T> output; 6799/// Computes the element-wise Xor of the two input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 6803public static Tensor<T> Xor<T>(in ReadOnlyTensorSpan<T> x, T y) 6806Tensor<T> output = Tensor.Create<T>(x.Lengths);
System\Numerics\Tensors\netcore\TensorHelpers.cs (4)
31internal static bool IsBroadcastableTo<T>(Tensor<T> tensor1, Tensor<T> tensor2) 92internal static bool IsUnderlyingStorageSameSize<T>(Tensor<T> tensor1, Tensor<T> tensor2)