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)
235return new Tensor<T>(input._values, lengths, false); 261Tensor<T> output = new Tensor<T>(input._values, lengths, strides); 2677outTensor = new Tensor<T>(values, lengths, Array.Empty<nint>(), tensor._isPinned); 2788return new Tensor<T>(tensor._values, arrLengths, strides); 2943Tensor<T> output = new Tensor<T>(values, lengths, false); 3234outputs[i] = new Tensor<T>(values, newShape); 3316return new Tensor<T>(tensor._values, lengths, strides); 3697return new Tensor<T>(tensor._values, lengths, strides);
534 references to Tensor
System.Numerics.Tensors (534)
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 (443)
64/// 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. 66/// <param name="source">Input <see cref="Tensor{T}"/>.</param> 67/// <param name="lengthsSource">Other <see cref="Tensor{T}"/> to make shapes broadcastable.</param> 68public static Tensor<T> Broadcast<T>(scoped in ReadOnlyTensorSpan<T> source, scoped in ReadOnlyTensorSpan<T> lengthsSource) 74/// 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. 77/// <param name="source">Input <see cref="Tensor{T}"/>.</param> 80public static Tensor<T> Broadcast<T>(scoped in ReadOnlyTensorSpan<T> source, scoped ReadOnlySpan<nint> lengths) 85Tensor<T> output = Tensor.CreateUninitialized<T>(intermediate.Lengths); 97public static void BroadcastTo<T>(this Tensor<T> source, in TensorSpan<T> destination) 139/// Broadcast the data from <paramref name="input"/> to the new shape <paramref name="shape"/>. Creates a new <see cref="Tensor{T}"/> 182/// Broadcast the data from <paramref name="input"/> to the new shape <paramref name="shape"/>. Creates a new <see cref="Tensor{T}"/> 225/// Broadcast the data from <paramref name="input"/> to the new shape <paramref name="lengths"/>. Creates a new <see cref="Tensor{T}"/> 229/// <param name="input">Input <see cref="Tensor{T}"/>.</param> 232internal static Tensor<T> LazyBroadcast<T>(Tensor<T> input, ReadOnlySpan<nint> lengths) 261Tensor<T> output = new Tensor<T>(input._values, lengths, strides); 272public static Tensor<T> Concatenate<T>(params scoped ReadOnlySpan<Tensor<T>> tensors) 282public static Tensor<T> ConcatenateOnDimension<T>(int dimension, params scoped ReadOnlySpan<Tensor<T>> tensors) 316Tensor<T> tensor; 338public static ref readonly TensorSpan<T> Concatenate<T>(scoped ReadOnlySpan<Tensor<T>> tensors, in TensorSpan<T> destination) 350public static ref readonly TensorSpan<T> ConcatenateOnDimension<T>(int dimension, scoped ReadOnlySpan<Tensor<T>> tensors, in TensorSpan<T> destination) 453public static Tensor<bool> Equals<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 456Tensor<bool> result; 534public static Tensor<bool> Equals<T>(in ReadOnlyTensorSpan<T> x, T y) 537Tensor<bool> result = Tensor.Create<bool>(x.Lengths, false); 757/// <param name="tensor">Input <see cref="Tensor{T}"/>.</param> 783/// <param name="tensor">Input <see cref="Tensor{T}"/>.</param> 814/// 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"/> 819/// <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 821public static Tensor<bool> GreaterThan<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 824Tensor<bool> result; 842/// 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"/> 848/// <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 900/// 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"/> 905/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/> 907public static Tensor<bool> GreaterThan<T>(in ReadOnlyTensorSpan<T> x, T y) 910Tensor<bool> result = Tensor.Create<bool>(x.Lengths, false); 917/// 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"/> 923/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/> 960/// 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"/> 965/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/> 967public static Tensor<bool> GreaterThan<T>(T x, in ReadOnlyTensorSpan<T> y) 970Tensor<bool> result = Tensor.Create<bool>(y.Lengths, false); 977/// 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"/> 983/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/> 1023/// 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"/> 1028/// <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 1030public static Tensor<bool> GreaterThanOrEqual<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 1033Tensor<bool> result; 1051/// 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"/> 1057/// <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 1109/// 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"/> 1114/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/> 1116public static Tensor<bool> GreaterThanOrEqual<T>(in ReadOnlyTensorSpan<T> x, T y) 1119Tensor<bool> result = Tensor.Create<bool>(x.Lengths, false); 1126/// 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"/> 1132/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/> 1169/// 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"/> 1174/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/> 1176public static Tensor<bool> GreaterThanOrEqual<T>(T x, in ReadOnlyTensorSpan<T> y) 1179Tensor<bool> result = Tensor.Create<bool>(y.Lengths, false); 1186/// 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"/> 1192/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/> 1726/// 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"/> 1731/// <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 1733public static Tensor<bool> LessThan<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 1736Tensor<bool> result; 1754/// 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"/> 1760/// <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 1811/// Compares the elements of a <see cref="Tensor{T}"/> to see which elements are less than <paramref name="y"/>. 1812/// 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"/> 1815/// <param name="x"><see cref="Tensor{T}"/> to compare.</param> 1817/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/> 1819public static Tensor<bool> LessThan<T>(in ReadOnlyTensorSpan<T> x, T y) 1822Tensor<bool> result = Tensor.Create<bool>(x.Lengths, false); 1828/// Compares the elements of a <see cref="Tensor{T}"/> to see which elements are less than <paramref name="y"/>. 1829/// 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"/> 1832/// <param name="x"><see cref="Tensor{T}"/> to compare.</param> 1835/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/> 1871/// Compares the elements of a <see cref="Tensor{T}"/> to see which elements are less than <paramref name="y"/>. 1872/// 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"/> 1875/// <param name="x"><see cref="Tensor{T}"/> to compare.</param> 1877/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/> 1879public static Tensor<bool> LessThan<T>(T x, in ReadOnlyTensorSpan<T> y) 1882Tensor<bool> result = Tensor.Create<bool>(y.Lengths, false); 1888/// Compares the elements of a <see cref="Tensor{T}"/> to see which elements are less than <paramref name="y"/>. 1889/// 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"/> 1892/// <param name="x"><see cref="Tensor{T}"/> to compare.</param> 1895/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/> 1935/// 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"/> 1940/// <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 1942public static Tensor<bool> LessThanOrEqual<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 1945Tensor<bool> result; 1963/// 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"/> 1969/// <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 2020/// Compares the elements of a <see cref="Tensor{T}"/> to see which elements are less than <paramref name="y"/>. 2021/// 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"/> 2024/// <param name="x"><see cref="Tensor{T}"/> to compare.</param> 2026/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/> 2028public static Tensor<bool> LessThanOrEqual<T>(in ReadOnlyTensorSpan<T> x, T y) 2031Tensor<bool> result = Tensor.Create<bool>(x.Lengths, false); 2037/// Compares the elements of a <see cref="Tensor{T}"/> to see which elements are less than <paramref name="y"/>. 2038/// 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"/> 2041/// <param name="x"><see cref="Tensor{T}"/> to compare.</param> 2044/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/> 2080/// Compares the elements of a <see cref="Tensor{T}"/> to see which elements are less than <paramref name="y"/>. 2081/// 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"/> 2084/// <param name="x"><see cref="Tensor{T}"/> to compare.</param> 2086/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/> 2088public static Tensor<bool> LessThanOrEqual<T>(T x, in ReadOnlyTensorSpan<T> y) 2091Tensor<bool> result = Tensor.Create<bool>(y.Lengths, false); 2097/// Compares the elements of a <see cref="Tensor{T}"/> to see which elements are less than <paramref name="y"/>. 2098/// 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"/> 2101/// <param name="x"><see cref="Tensor{T}"/> to compare.</param> 2104/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/> 2638/// If <paramref name="tensor"/> is a 1D tensor, it will return <paramref name="tensor"/>. Otherwise it creates a new <see cref="Tensor{T}"/> 2641/// <param name="tensor">Input <see cref="Tensor{T}"/></param> 2643public static Tensor<T> PermuteDimensions<T>(this Tensor<T> tensor, params ReadOnlySpan<int> dimensions) 2653Tensor<T> outTensor; 2728/// <param name="tensor"><see cref="Tensor{T}"/> you want to reshape.</param> 2730public static Tensor<T> Reshape<T>(this Tensor<T> tensor, params ReadOnlySpan<nint> lengths) 2934/// 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 2937/// <param name="tensor">Input <see cref="Tensor{T}"/>.</param> 2939public static Tensor<T> Resize<T>(Tensor<T> tensor, ReadOnlySpan<nint> lengths) 2943Tensor<T> output = new Tensor<T>(values, lengths, false); 2958/// <param name="tensor">Input <see cref="Tensor{T}"/>.</param> 2960public static void ResizeTo<T>(scoped in Tensor<T> tensor, in TensorSpan<T> destination) 3007/// <param name="tensor">Input <see cref="Tensor{T}"/>.</param> 3008public static Tensor<T> Reverse<T>(in ReadOnlyTensorSpan<T> tensor) 3010Tensor<T> output = Tensor.Create<T>(tensor.Lengths); 3020/// <param name="tensor">Input <see cref="Tensor{T}"/>.</param> 3022public static Tensor<T> ReverseDimension<T>(in ReadOnlyTensorSpan<T> tensor, int dimension) 3024Tensor<T> output = Tensor.Create<T>(tensor.Lengths); 3144/// <param name="tensor">Input <see cref="Tensor{T}"/>.</param> 3147public static Tensor<T> SetSlice<T>(this Tensor<T> tensor, in ReadOnlyTensorSpan<T> values, params ReadOnlySpan<NRange> ranges) 3157/// <param name="tensor">Input <see cref="Tensor{T}"/>.</param> 3186/// Split a <see cref="Tensor{T}"/> into <paramref name="splitCount"/> along the given <paramref name="dimension"/>. If the tensor cannot be split 3189/// <param name="tensor">Input <see cref="Tensor{T}"/>.</param> 3192public static Tensor<T>[] Split<T>(scoped in ReadOnlyTensorSpan<T> tensor, int splitCount, nint dimension) 3197Tensor<T>[] outputs = new Tensor<T>[splitCount]; 3266/// <param name="tensor">The <see cref="Tensor{T}"/> to remove all dimensions of length 1.</param> 3267public static Tensor<T> Squeeze<T>(this Tensor<T> tensor) 3276/// <param name="tensor">The <see cref="Tensor{T}"/> to remove dimension of length 1.</param> 3278public static Tensor<T> SqueezeDimension<T>(this Tensor<T> tensor, int dimension) 3434/// Join multiple <see cref="Tensor{T}"/> along a new dimension that is added at position 0. All tensors must have the same shape. 3436/// <param name="tensors">Input <see cref="Tensor{T}"/>.</param> 3437public static Tensor<T> Stack<T>(params ReadOnlySpan<Tensor<T>> tensors) 3443/// 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. 3445/// <param name="tensors">Input <see cref="Tensor{T}"/>.</param> 3447public static Tensor<T> StackAlongDimension<T>(int dimension, params ReadOnlySpan<Tensor<T>> tensors) 3461Tensor<T>[] outputs = new Tensor<T>[tensors.Length]; 3470/// Join multiple <see cref="Tensor{T}"/> along a new dimension that is added at position 0. All tensors must have the same shape. 3472/// <param name="tensors">Input <see cref="Tensor{T}"/>.</param> 3474public static ref readonly TensorSpan<T> Stack<T>(scoped in ReadOnlySpan<Tensor<T>> tensors, in TensorSpan<T> destination) 3480/// 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. 3482/// <param name="tensors">Input <see cref="Tensor{T}"/>.</param> 3485public static ref readonly TensorSpan<T> StackAlongDimension<T>(scoped ReadOnlySpan<Tensor<T>> tensors, in TensorSpan<T> destination, int dimension) 3499Tensor<T>[] outputs = new Tensor<T>[tensors.Length]; 3518Tensor<T> temp = CreateUninitialized<T>(x.Lengths); 3589/// Creates a <see cref="string"/> representation of the <see cref="Tensor{T}"/>."/> 3594public static string ToString<T>(this Tensor<T> tensor, params ReadOnlySpan<nint> maximumLengths) => ((ReadOnlyTensorSpan<T>)tensor).ToString(maximumLengths); 3602/// <param name="tensor">Input <see cref="Tensor{T}"/>.</param> 3603public static Tensor<T> Transpose<T>(Tensor<T> tensor) 3624/// <param name="tensor">Input <see cref="Tensor{T}"/>.</param> 3626public static bool TryBroadcastTo<T>(this Tensor<T> tensor, in TensorSpan<T> destination) 3666/// <param name="tensor">The <see cref="Tensor{T}"/> to add a dimension of length 1.</param> 3668public static Tensor<T> Unsqueeze<T>(this Tensor<T> tensor, int dimension) 3778/// Takes the absolute value of each element of the <see cref="Tensor{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 3781public static Tensor<T> Abs<T>(in ReadOnlyTensorSpan<T> x) 3784Tensor<T> output = Tensor.Create<T>(x.Lengths); 3803/// Takes the inverse cosine of each element of the <see cref="Tensor{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 3806public static Tensor<T> Acos<T>(in ReadOnlyTensorSpan<T> x) 3809Tensor<T> output = Tensor.Create<T>(x.Lengths); 3815/// Takes the inverse cosine of each element of the <see cref="Tensor{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 3828/// 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. 3831public static Tensor<T> Acosh<T>(in ReadOnlyTensorSpan<T> x) 3834Tensor<T> output = Tensor.Create<T>(x.Lengths); 3853/// 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. 3856public static Tensor<T> AcosPi<T>(in ReadOnlyTensorSpan<T> x) 3859Tensor<T> output = Tensor.Create<T>(x.Lengths); 3878/// 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. 3882public static Tensor<T> Add<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 3885Tensor<T> output; 3900/// Adds <paramref name="y"/> to each element of <paramref name="x"/> and returns a new <see cref="Tensor{T}"/> with the result. 3904public static Tensor<T> Add<T>(in ReadOnlyTensorSpan<T> x, T y) 3907Tensor<T> output = Tensor.Create<T>(x.Lengths); 3939/// Takes the inverse sin of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 3942public static Tensor<T> Asin<T>(in ReadOnlyTensorSpan<T> x) 3945Tensor<T> output = Tensor.Create<T>(x.Lengths); 3964/// 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. 3967public static Tensor<T> Asinh<T>(in ReadOnlyTensorSpan<T> x) 3970Tensor<T> output = Tensor.Create<T>(x.Lengths); 3989/// 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. 3992public static Tensor<T> AsinPi<T>(in ReadOnlyTensorSpan<T> x) 3995Tensor<T> output = Tensor.Create<T>(x.Lengths); 4014/// Takes the arc tangent of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 4017public static Tensor<T> Atan<T>(in ReadOnlyTensorSpan<T> x) 4020Tensor<T> output = Tensor.Create<T>(x.Lengths); 4039/// Takes the arc tangent of the two input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 4043public static Tensor<T> Atan2<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 4046Tensor<T> output; 4073/// Takes the arc tangent of the two input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 4077public static Tensor<T> Atan2<T>(in ReadOnlyTensorSpan<T> x, T y) 4080Tensor<T> output = Tensor.Create<T>(x.Lengths); 4099/// Takes the arc tangent of the two input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 4103public static Tensor<T> Atan2<T>(T x, in ReadOnlyTensorSpan<T> y) 4106Tensor<T> output = Tensor.Create<T>(y.Lengths); 4127/// 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. 4131public static Tensor<T> Atan2Pi<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 4134Tensor<T> output; 4165public static Tensor<T> Atan2Pi<T>(in ReadOnlyTensorSpan<T> x, T y) 4168Tensor<T> output = Tensor.Create<T>(x.Lengths); 4191public static Tensor<T> Atan2Pi<T>(T x, in ReadOnlyTensorSpan<T> y) 4194Tensor<T> output = Tensor.Create<T>(y.Lengths); 4216/// 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. 4219public static Tensor<T> Atanh<T>(in ReadOnlyTensorSpan<T> x) 4222Tensor<T> output = Tensor.Create<T>(x.Lengths); 4241/// 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. 4244public static Tensor<T> AtanPi<T>(in ReadOnlyTensorSpan<T> x) 4247Tensor<T> output = Tensor.Create<T>(x.Lengths); 4266/// 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. 4270public static Tensor<T> BitwiseAnd<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 4273Tensor<T> output; 4300/// 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. 4304public static Tensor<T> BitwiseAnd<T>(in ReadOnlyTensorSpan<T> x, T y) 4307Tensor<T> output = Tensor.Create<T>(x.Lengths); 4328/// 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. 4332public static Tensor<T> BitwiseOr<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 4335Tensor<T> output; 4362/// 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. 4366public static Tensor<T> BitwiseOr<T>(in ReadOnlyTensorSpan<T> x, T y) 4369Tensor<T> output = Tensor.Create<T>(x.Lengths); 4390/// Computes the element-wise cube root of the input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 4393public static Tensor<T> Cbrt<T>(in ReadOnlyTensorSpan<T> x) 4396Tensor<T> output = Tensor.Create<T>(x.Lengths); 4415/// Computes the element-wise ceiling of the input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 4418public static Tensor<T> Ceiling<T>(in ReadOnlyTensorSpan<T> x) 4421Tensor<T> output = Tensor.Create<T>(x.Lengths); 4444public static Tensor<TTo> ConvertChecked<TFrom, TTo>(in ReadOnlyTensorSpan<TFrom> source) 4448Tensor<TTo> output = Tensor.Create<TTo>(source.Lengths); 4474public static Tensor<TTo> ConvertSaturating<TFrom, TTo>(in ReadOnlyTensorSpan<TFrom> source) 4478Tensor<TTo> output = Tensor.Create<TTo>(source.Lengths); 4504public static Tensor<TTo> ConvertTruncating<TFrom, TTo>(in ReadOnlyTensorSpan<TFrom> source) 4508Tensor<TTo> output = Tensor.Create<TTo>(source.Lengths); 4534public static Tensor<T> CopySign<T>(in ReadOnlyTensorSpan<T> x, T sign) 4537Tensor<T> output = Create<T>(x.Lengths); 4544/// 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. 4548public static Tensor<T> CopySign<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> sign) 4551Tensor<T> output; 4592/// Takes the cosine of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 4595public static Tensor<T> Cos<T>(in ReadOnlyTensorSpan<T> x) 4598Tensor<T> output = Tensor.Create<T>(x.Lengths); 4617/// Takes the hyperbolic cosine of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 4620public static Tensor<T> Cosh<T>(in ReadOnlyTensorSpan<T> x) 4623Tensor<T> output = Tensor.Create<T>(x.Lengths); 4646public static Tensor<T> CosineSimilarity<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 4663Tensor<T> output = Tensor.Create<T>(values, [dim1, dim2]); 4723/// <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> 4737public static Tensor<T> CosPi<T>(in ReadOnlyTensorSpan<T> x) 4740Tensor<T> output = Tensor.Create<T>(x.Lengths); 4772public static Tensor<T> DegreesToRadians<T>(in ReadOnlyTensorSpan<T> x) 4775Tensor<T> output = Tensor.Create<T>(x.Lengths); 4807/// Divides each element of <paramref name="x"/> by <paramref name="y"/> and returns a new <see cref="Tensor{T}"/> with the result. 4811public static Tensor<T> Divide<T>(in ReadOnlyTensorSpan<T> x, T y) 4814Tensor<T> output = Create<T>(x.Lengths); 4820/// Divides <paramref name="x"/> by each element of <paramref name="y"/> and returns a new <see cref="Tensor{T}"/> with the result."/> 4824public static Tensor<T> Divide<T>(T x, in ReadOnlyTensorSpan<T> y) 4827Tensor<T> output = Tensor.Create<T>(y.Lengths); 4838public static Tensor<T> Divide<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 4841Tensor<T> output; 4911public static Tensor<T> Exp<T>(in ReadOnlyTensorSpan<T> x) 4914Tensor<T> output = Tensor.Create<T>(x.Lengths); 4936public static Tensor<T> Exp10<T>(in ReadOnlyTensorSpan<T> x) 4939Tensor<T> output = Tensor.Create<T>(x.Lengths); 4959public static Tensor<T> Exp10M1<T>(in ReadOnlyTensorSpan<T> x) 4962Tensor<T> output = Tensor.Create<T>(x.Lengths); 4980public static Tensor<T> Exp2<T>(in ReadOnlyTensorSpan<T> x) 4983Tensor<T> output = Tensor.Create<T>(x.Lengths); 5001public static Tensor<T> Exp2M1<T>(in ReadOnlyTensorSpan<T> x) 5004Tensor<T> output = Tensor.Create<T>(x.Lengths); 5022public static Tensor<T> ExpM1<T>(in ReadOnlyTensorSpan<T> x) 5025Tensor<T> output = Tensor.Create<T>(x.Lengths); 5043public static Tensor<T> Floor<T>(in ReadOnlyTensorSpan<T> x) 5046Tensor<T> output = Tensor.Create<T>(x.Lengths); 5068public static Tensor<T> Hypot<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 5071Tensor<T> output; 5104public static Tensor<T> Ieee754Remainder<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 5107Tensor<T> output; 5135public static Tensor<T> Ieee754Remainder<T>(in ReadOnlyTensorSpan<T> x, T y) 5138Tensor<T> output = Tensor.Create<T>(x.Lengths); 5157public static Tensor<T> Ieee754Remainder<T>(T x, in ReadOnlyTensorSpan<T> y) 5160Tensor<T> output = Tensor.Create<T>(y.Lengths); 5180public static Tensor<int> ILogB<T>(in ReadOnlyTensorSpan<T> x) 5183Tensor<int> output = Tensor.Create<int>(x.Lengths, x.Strides); 5249public static Tensor<T> LeadingZeroCount<T>(in ReadOnlyTensorSpan<T> x) 5252Tensor<T> output = Tensor.Create<T>(x.Lengths); 5271/// Takes the natural logarithm of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 5274public static Tensor<T> Log<T>(in ReadOnlyTensorSpan<T> x) 5277Tensor<T> output = Tensor.Create<T>(x.Lengths); 5296public static Tensor<T> Log<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 5299Tensor<T> output; 5326public static Tensor<T> Log<T>(in ReadOnlyTensorSpan<T> x, T y) 5329Tensor<T> output = Tensor.Create<T>(x.Lengths); 5348/// 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. 5351public static Tensor<T> Log10<T>(in ReadOnlyTensorSpan<T> x) 5354Tensor<T> output = Tensor.Create<T>(x.Lengths); 5373/// 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. 5376public static Tensor<T> Log10P1<T>(in ReadOnlyTensorSpan<T> x) 5379Tensor<T> output = Tensor.Create<T>(x.Lengths); 5398/// 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. 5401public static Tensor<T> Log2<T>(in ReadOnlyTensorSpan<T> x) 5404Tensor<T> output = Tensor.Create<T>(x.Lengths); 5423/// 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. 5426public static Tensor<T> Log2P1<T>(in ReadOnlyTensorSpan<T> x) 5429Tensor<T> output = Tensor.Create<T>(x.Lengths); 5448/// 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. 5451public static Tensor<T> LogP1<T>(in ReadOnlyTensorSpan<T> x) 5454Tensor<T> output = Tensor.Create<T>(x.Lengths); 5483public static Tensor<T> Max<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 5486Tensor<T> output; 5513public static Tensor<T> Max<T>(in ReadOnlyTensorSpan<T> x, T y) 5516Tensor<T> output = Tensor.Create<T>(x.Lengths); 5544public static Tensor<T> MaxMagnitude<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 5547Tensor<T> output; 5574public static Tensor<T> MaxMagnitude<T>(in ReadOnlyTensorSpan<T> x, T y) 5577Tensor<T> output = Tensor.Create<T>(x.Lengths); 5605public static Tensor<T> MaxMagnitudeNumber<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 5608Tensor<T> output; 5635public static Tensor<T> MaxMagnitudeNumber<T>(in ReadOnlyTensorSpan<T> x, T y) 5638Tensor<T> output = Tensor.Create<T>(x.Lengths); 5666public static Tensor<T> MaxNumber<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 5669Tensor<T> output; 5696public static Tensor<T> MaxNumber<T>(in ReadOnlyTensorSpan<T> x, T y) 5699Tensor<T> output = Tensor.Create<T>(x.Lengths); 5727public static Tensor<T> Min<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 5730Tensor<T> output; 5757public static Tensor<T> Min<T>(in ReadOnlyTensorSpan<T> x, T y) 5760Tensor<T> output = Tensor.Create<T>(x.Lengths); 5788public static Tensor<T> MinMagnitude<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 5791Tensor<T> output; 5818public static Tensor<T> MinMagnitude<T>(in ReadOnlyTensorSpan<T> x, T y) 5821Tensor<T> output = Tensor.Create<T>(x.Lengths); 5849public static Tensor<T> MinMagnitudeNumber<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 5852Tensor<T> output; 5879public static Tensor<T> MinMagnitudeNumber<T>(in ReadOnlyTensorSpan<T> x, T y) 5882Tensor<T> output = Tensor.Create<T>(x.Lengths); 5910public static Tensor<T> MinNumber<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 5913Tensor<T> output; 5940public static Tensor<T> MinNumber<T>(in ReadOnlyTensorSpan<T> x, T y) 5943Tensor<T> output = Tensor.Create<T>(x.Lengths); 5961/// Multiplies each element of <paramref name="x"/> with <paramref name="y"/> and returns a new <see cref="Tensor{T}"/> with the result. 5965public static Tensor<T> Multiply<T>(in ReadOnlyTensorSpan<T> x, T y) 5968Tensor<T> output = Tensor.Create<T>(x.Lengths); 5974/// Multiplies each element of <paramref name="x"/> with <paramref name="y"/> and returns a new <see cref="Tensor{T}"/> with the result. 5979public static Tensor<T> Multiply<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 5982Tensor<T> output; 6028public static Tensor<T> Negate<T>(in ReadOnlyTensorSpan<T> x) 6031Tensor<T> output = Tensor.Create<T>(x.Lengths); 6061public static Tensor<T> OnesComplement<T>(in ReadOnlyTensorSpan<T> x) 6064Tensor<T> output = Tensor.Create<T>(x.Lengths); 6082public static Tensor<T> PopCount<T>(in ReadOnlyTensorSpan<T> x) 6085Tensor<T> output = Tensor.Create<T>(x.Lengths); 6104public static Tensor<T> Pow<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 6107Tensor<T> output; 6134public static Tensor<T> Pow<T>(in ReadOnlyTensorSpan<T> x, T y) 6137Tensor<T> output = Tensor.Create<T>(x.Lengths); 6156public static Tensor<T> Pow<T>(T x, in ReadOnlyTensorSpan<T> y) 6159Tensor<T> output = Tensor.Create<T>(y.Lengths); 6189public static Tensor<T> RadiansToDegrees<T>(in ReadOnlyTensorSpan<T> x) 6192Tensor<T> output = Tensor.Create<T>(x.Lengths); 6210public static Tensor<T> Reciprocal<T>(in ReadOnlyTensorSpan<T> x) 6213Tensor<T> output = Tensor.Create<T>(x.Lengths); 6232public static Tensor<T> RootN<T>(in ReadOnlyTensorSpan<T> x, int n) 6235Tensor<T> output = Tensor.Create<T>(x.Lengths); 6262public static Tensor<T> RotateLeft<T>(in ReadOnlyTensorSpan<T> x, int rotateAmount) 6265Tensor<T> output = Tensor.Create<T>(x.Lengths); 6293public static Tensor<T> RotateRight<T>(in ReadOnlyTensorSpan<T> x, int rotateAmount) 6296Tensor<T> output = Tensor.Create<T>(x.Lengths); 6322public static Tensor<T> Round<T>(in ReadOnlyTensorSpan<T> x) 6325Tensor<T> output = Tensor.Create<T>(x.Lengths); 6343public static Tensor<T> Round<T>(in ReadOnlyTensorSpan<T> x, int digits, MidpointRounding mode) 6346Tensor<T> output = Tensor.Create<T>(x.Lengths); 6371public static Tensor<T> Round<T>(in ReadOnlyTensorSpan<T> x, int digits) 6374Tensor<T> output = Tensor.Create<T>(x.Lengths); 6398public static Tensor<T> Round<T>(in ReadOnlyTensorSpan<T> x, MidpointRounding mode) 6401Tensor<T> output = Tensor.Create<T>(x.Lengths); 6426public static Tensor<T> Sigmoid<T>(in ReadOnlyTensorSpan<T> x) 6429Tensor<T> output = Tensor.Create<T>(x.Lengths); 6446/// Takes the sin of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 6449public static Tensor<T> Sin<T>(in ReadOnlyTensorSpan<T> x) 6452Tensor<T> output = Tensor.Create<T>(x.Lengths); 6472public static Tensor<T> Sinh<T>(in ReadOnlyTensorSpan<T> x) 6475Tensor<T> output = Tensor.Create<T>(x.Lengths); 6493public static Tensor<T> SinPi<T>(in ReadOnlyTensorSpan<T> x) 6496Tensor<T> output = Tensor.Create<T>(x.Lengths); 6514public static Tensor<T> SoftMax<T>(in ReadOnlyTensorSpan<T> x) 6517Tensor<T> output = Tensor.Create<T>(x.Lengths); 6534/// Takes the square root of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 6537public static Tensor<T> Sqrt<T>(in ReadOnlyTensorSpan<T> x) 6540Tensor<T> output = Tensor.Create<T>(x.Lengths); 6559/// Subtracts <paramref name="y"/> from each element of <paramref name="x"/> and returns a new <see cref="Tensor{T}"/> with the result. 6563public static Tensor<T> Subtract<T>(in ReadOnlyTensorSpan<T> x, T y) 6566Tensor<T> output = Create<T>(x.Lengths); 6572/// Subtracts each element of <paramref name="y"/> from <paramref name="x"/> and returns a new <see cref="Tensor{T}"/> with the result. 6576public static Tensor<T> Subtract<T>(T x, in ReadOnlyTensorSpan<T> y) 6579Tensor<T> output = Create<T>(y.Lengths); 6585/// Subtracts each element of <paramref name="x"/> from <paramref name="y"/> and returns a new <see cref="Tensor{T}"/> with the result. 6589public static Tensor<T> Subtract<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 6592Tensor<T> output; 6672public static Tensor<T> Tan<T>(in ReadOnlyTensorSpan<T> x) 6675Tensor<T> output = Tensor.Create<T>(x.Lengths); 6693public static Tensor<T> Tanh<T>(in ReadOnlyTensorSpan<T> x) 6696Tensor<T> output = Tensor.Create<T>(x.Lengths); 6714public static Tensor<T> TanPi<T>(in ReadOnlyTensorSpan<T> x) 6717Tensor<T> output = Tensor.Create<T>(x.Lengths); 6735public static Tensor<T> TrailingZeroCount<T>(in ReadOnlyTensorSpan<T> x) 6738Tensor<T> output = Tensor.Create<T>(x.Lengths); 6756public static Tensor<T> Truncate<T>(in ReadOnlyTensorSpan<T> x) 6759Tensor<T> output = Tensor.Create<T>(x.Lengths); 6778public static Tensor<T> Xor<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 6781Tensor<T> output; 6806/// Computes the element-wise Xor of the two input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 6810public static Tensor<T> Xor<T>(in ReadOnlyTensorSpan<T> x, T y) 6813Tensor<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)