14 instantiations of Tensor
System.Numerics.Tensors (14)
System\Numerics\Tensors\netcore\Tensor.cs (6)
99return new Tensor<T>(values, lengths.ToArray(), pinned); 112return new Tensor<T>(values, lengths.ToArray(), strides.ToArray(), pinned); 124return new Tensor<T>(values, lengths.ToArray(), pinned); 137return new Tensor<T>(values, lengths.ToArray(), strides.ToArray(), pinned); 144public static Tensor<T> Empty { get; } = new(); 467var outTensor = new Tensor<T>(values, s.Lengths.ToArray(), _isPinned);
System\Numerics\Tensors\netcore\TensorExtensions.cs (8)
236return new Tensor<T>(input._values, lengths, false); 262Tensor<T> output = new Tensor<T>(input._values, lengths, strides); 2678outTensor = new Tensor<T>(values, lengths, Array.Empty<nint>(), tensor._isPinned); 2789return new Tensor<T>(tensor._values, arrLengths, strides); 2944Tensor<T> output = new Tensor<T>(values, lengths, false); 3235outputs[i] = new Tensor<T>(values, newShape); 3317return new Tensor<T>(tensor._values, lengths, strides); 3678return new Tensor<T>(tensor._values, lengths, strides);
533 references to Tensor
System.Numerics.Tensors (533)
System\Numerics\Tensors\netcore\Tensor.cs (63)
26: ITensor<Tensor<T>, T> 91/// 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. 95static Tensor<T> ITensor<Tensor<T>, T>.Create(ReadOnlySpan<nint> lengths, bool pinned) 103/// 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. 108static Tensor<T> ITensor<Tensor<T>, T>.Create(ReadOnlySpan<nint> lengths, ReadOnlySpan<nint> strides, bool pinned) 116/// Creates a <see cref="Tensor{T}"/> and does not initialize it. If <paramref name="pinned"/> is true, the memory will be pinned. 120static Tensor<T> ITensor<Tensor<T>, T>.CreateUninitialized(ReadOnlySpan<nint> lengths, bool pinned) 128/// Creates a <see cref="Tensor{T}"/> and does not initialize it. If <paramref name="pinned"/> is true, the memory will be pinned. 133static Tensor<T> ITensor<Tensor<T>, T>.CreateUninitialized(ReadOnlySpan<nint> lengths, ReadOnlySpan<nint> strides, bool pinned) 144public static Tensor<T> Empty { get; } = new(); 147/// Gets a value indicating whether this <see cref="Tensor{T}"/> is empty. 153/// Gets a value indicating whether the backing memory of the <see cref="Tensor{T}"/> is pinned."/> 159/// Gets a value indicating the rank, or number of dimensions, of this <see cref="Tensor{T}"/>. 165/// The number of items in the <see cref="Tensor{T}"/>. 171/// Gets the length of each dimension in this <see cref="Tensor{T}"/>. 177/// Gets the length of each dimension in this <see cref="Tensor{T}"/>. 180ReadOnlySpan<nint> IReadOnlyTensor<Tensor<T>, T>.Lengths => _lengths; 184/// Gets the strides of each dimension in this <see cref="Tensor{T}"/>. 190/// Gets the strides of each dimension in this <see cref="Tensor{T}"/>. 193ReadOnlySpan<nint> IReadOnlyTensor<Tensor<T>, T>.Strides => _strides; 195bool ITensor<Tensor<T>, T>.IsReadOnly => false; 225public Tensor<T> this[params ReadOnlySpan<NRange> ranges] 261T ITensor<Tensor<T>, T>.this[params ReadOnlySpan<nint> indexes] 281T ITensor<Tensor<T>, T>.this[params ReadOnlySpan<NIndex> indexes] 301T IReadOnlyTensor<Tensor<T>, T>.this[params ReadOnlySpan<nint> indexes] => AsReadOnlyTensorSpan()[indexes]; 311T IReadOnlyTensor<Tensor<T>, T>.this[params ReadOnlySpan<NIndex> indexes] => AsReadOnlyTensorSpan()[indexes]; 321Tensor<T> IReadOnlyTensor<Tensor<T>, T>.this[params ReadOnlySpan<NRange> ranges] 339public Tensor<T> this[Tensor<bool> filter] 372/// Defines an implicit conversion of an array to a <see cref="Tensor{T}"/>. 374public static implicit operator Tensor<T>(T[] array) => new Tensor<T>(array, [array.Length]); 377/// Defines an implicit conversion of a <see cref="Tensor{T}"/> to a <see cref="TensorSpan{T}"/>. 379public static implicit operator TensorSpan<T>(Tensor<T> value) => new TensorSpan<T>(ref MemoryMarshal.GetArrayDataReference(value._values), value._lengths, value._strides, value._flattenedLength); 382/// Defines an implicit conversion of a <see cref="Tensor{T}"/> to a <see cref="TensorSpan{T}"/>. 384public static implicit operator ReadOnlyTensorSpan<T>(Tensor<T> value) => new ReadOnlyTensorSpan<T>(ref MemoryMarshal.GetArrayDataReference(value._values), value._lengths, value._strides, value.FlattenedLength); 387/// Converts this <see cref="Tensor{T}"/> to a <see cref="TensorSpan{T}"/> pointing to the same backing memory."/> 393/// Converts this <see cref="Tensor{T}"/> to a <see cref="TensorSpan{T}"/> pointing to the same backing memory based on the provided ranges."/> 400/// Converts this <see cref="Tensor{T}"/> to a <see cref="TensorSpan{T}"/> pointing to the same backing memory based on the provided start locations."/> 407/// Converts this <see cref="Tensor{T}"/> to a <see cref="TensorSpan{T}"/> pointing to the same backing memory based on the provided start indexes."/> 414/// Converts this <see cref="Tensor{T}"/> to a <see cref="ReadOnlyTensorSpan{T}"/> pointing to the same backing memory."/> 420/// Converts this <see cref="Tensor{T}"/> to a <see cref="ReadOnlyTensorSpan{T}"/> pointing to the same backing memory based on the provided ranges."/> 427/// Converts this <see cref="Tensor{T}"/> to a <see cref="ReadOnlyTensorSpan{T}"/> pointing to the same backing memory based on the provided start locations."/> 434/// Converts this <see cref="Tensor{T}"/> to a <see cref="ReadOnlyTensorSpan{T}"/> pointing to the same backing memory based on the provided start indexes."/> 452ref readonly T IReadOnlyTensor<Tensor<T>, T>.GetPinnableReference() => ref AsReadOnlyTensorSpan().GetPinnableReference(); 458/// <returns><see cref="Tensor{T}"/> as a copy of the provided ranges.</returns> 460public Tensor<T> Slice(params ReadOnlySpan<NRange> start) 467var outTensor = new Tensor<T>(values, s.Lengths.ToArray(), _isPinned); 476/// <returns><see cref="Tensor{T}"/> as a copy of the provided ranges.</returns> 478public Tensor<T> Slice(params ReadOnlySpan<nint> start) 492/// <returns><see cref="Tensor{T}"/> as a copy of the provided ranges.</returns> 494public Tensor<T> Slice(params ReadOnlySpan<NIndex> startIndex) 552/// Gets an <see cref="IEnumerator{T}"/> for the <see cref="Tensor{T}"/>. 559/// Gets an <see cref="IEnumerator{T}"/> for the <see cref="Tensor{T}"/>. 565/// Gets an <see cref="IEnumerator"/> for the <see cref="Tensor{T}"/>."/> 573private readonly Tensor<T> _tensor; 583internal Enumerator(Tensor<T> tensor) 630/// Gets the hash code for the <see cref="Tensor{T}"/>. 671/// <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)
65/// 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. 67/// <param name="source">Input <see cref="Tensor{T}"/>.</param> 68/// <param name="lengthsSource">Other <see cref="Tensor{T}"/> to make shapes broadcastable.</param> 69public static Tensor<T> Broadcast<T>(scoped in ReadOnlyTensorSpan<T> source, scoped in ReadOnlyTensorSpan<T> lengthsSource) 75/// 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. 78/// <param name="source">Input <see cref="Tensor{T}"/>.</param> 81public static Tensor<T> Broadcast<T>(scoped in ReadOnlyTensorSpan<T> source, scoped ReadOnlySpan<nint> lengths) 86Tensor<T> output = Tensor.CreateUninitialized<T>(intermediate.Lengths); 98public static void BroadcastTo<T>(this Tensor<T> source, in TensorSpan<T> destination) 140/// Broadcast the data from <paramref name="input"/> to the new shape <paramref name="shape"/>. Creates a new <see cref="Tensor{T}"/> 183/// Broadcast the data from <paramref name="input"/> to the new shape <paramref name="shape"/>. Creates a new <see cref="Tensor{T}"/> 226/// Broadcast the data from <paramref name="input"/> to the new shape <paramref name="lengths"/>. Creates a new <see cref="Tensor{T}"/> 230/// <param name="input">Input <see cref="Tensor{T}"/>.</param> 233internal static Tensor<T> LazyBroadcast<T>(Tensor<T> input, ReadOnlySpan<nint> lengths) 262Tensor<T> output = new Tensor<T>(input._values, lengths, strides); 273public static Tensor<T> Concatenate<T>(params scoped ReadOnlySpan<Tensor<T>> tensors) 283public static Tensor<T> ConcatenateOnDimension<T>(int dimension, params scoped ReadOnlySpan<Tensor<T>> tensors) 317Tensor<T> tensor; 339public static ref readonly TensorSpan<T> Concatenate<T>(scoped ReadOnlySpan<Tensor<T>> tensors, in TensorSpan<T> destination) 351public static ref readonly TensorSpan<T> ConcatenateOnDimension<T>(int dimension, scoped ReadOnlySpan<Tensor<T>> tensors, in TensorSpan<T> destination) 454public static Tensor<bool> Equals<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 457Tensor<bool> result; 535public static Tensor<bool> Equals<T>(in ReadOnlyTensorSpan<T> x, T y) 538Tensor<bool> result = Tensor.Create<bool>(x.Lengths, false); 758/// <param name="tensor">Input <see cref="Tensor{T}"/>.</param> 784/// <param name="tensor">Input <see cref="Tensor{T}"/>.</param> 815/// 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"/> 820/// <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 822public static Tensor<bool> GreaterThan<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 825Tensor<bool> result; 843/// 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"/> 849/// <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 901/// 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"/> 906/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/> 908public static Tensor<bool> GreaterThan<T>(in ReadOnlyTensorSpan<T> x, T y) 911Tensor<bool> result = Tensor.Create<bool>(x.Lengths, false); 918/// 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"/> 924/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/> 961/// 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"/> 966/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/> 968public static Tensor<bool> GreaterThan<T>(T x, in ReadOnlyTensorSpan<T> y) 971Tensor<bool> result = Tensor.Create<bool>(y.Lengths, false); 978/// 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"/> 984/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/> 1024/// 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"/> 1029/// <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 1031public static Tensor<bool> GreaterThanOrEqual<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 1034Tensor<bool> result; 1052/// 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"/> 1058/// <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 1110/// 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"/> 1115/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/> 1117public static Tensor<bool> GreaterThanOrEqual<T>(in ReadOnlyTensorSpan<T> x, T y) 1120Tensor<bool> result = Tensor.Create<bool>(x.Lengths, false); 1127/// 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"/> 1133/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/> 1170/// 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"/> 1175/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/> 1177public static Tensor<bool> GreaterThanOrEqual<T>(T x, in ReadOnlyTensorSpan<T> y) 1180Tensor<bool> result = Tensor.Create<bool>(y.Lengths, false); 1187/// 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"/> 1193/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/> 1727/// 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"/> 1732/// <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 1734public static Tensor<bool> LessThan<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 1737Tensor<bool> result; 1755/// 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"/> 1761/// <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 1812/// Compares the elements of a <see cref="Tensor{T}"/> to see which elements are less than <paramref name="y"/>. 1813/// 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"/> 1816/// <param name="x"><see cref="Tensor{T}"/> to compare.</param> 1818/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/> 1820public static Tensor<bool> LessThan<T>(in ReadOnlyTensorSpan<T> x, T y) 1823Tensor<bool> result = Tensor.Create<bool>(x.Lengths, false); 1829/// Compares the elements of a <see cref="Tensor{T}"/> to see which elements are less than <paramref name="y"/>. 1830/// 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"/> 1833/// <param name="x"><see cref="Tensor{T}"/> to compare.</param> 1836/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/> 1872/// Compares the elements of a <see cref="Tensor{T}"/> to see which elements are less than <paramref name="y"/>. 1873/// 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"/> 1876/// <param name="x"><see cref="Tensor{T}"/> to compare.</param> 1878/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/> 1880public static Tensor<bool> LessThan<T>(T x, in ReadOnlyTensorSpan<T> y) 1883Tensor<bool> result = Tensor.Create<bool>(y.Lengths, false); 1889/// Compares the elements of a <see cref="Tensor{T}"/> to see which elements are less than <paramref name="y"/>. 1890/// 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"/> 1893/// <param name="x"><see cref="Tensor{T}"/> to compare.</param> 1896/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/> 1936/// 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"/> 1941/// <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 1943public static Tensor<bool> LessThanOrEqual<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 1946Tensor<bool> result; 1964/// 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"/> 1970/// <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 2021/// Compares the elements of a <see cref="Tensor{T}"/> to see which elements are less than <paramref name="y"/>. 2022/// 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"/> 2025/// <param name="x"><see cref="Tensor{T}"/> to compare.</param> 2027/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/> 2029public static Tensor<bool> LessThanOrEqual<T>(in ReadOnlyTensorSpan<T> x, T y) 2032Tensor<bool> result = Tensor.Create<bool>(x.Lengths, false); 2038/// Compares the elements of a <see cref="Tensor{T}"/> to see which elements are less than <paramref name="y"/>. 2039/// 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"/> 2042/// <param name="x"><see cref="Tensor{T}"/> to compare.</param> 2045/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/> 2081/// Compares the elements of a <see cref="Tensor{T}"/> to see which elements are less than <paramref name="y"/>. 2082/// 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"/> 2085/// <param name="x"><see cref="Tensor{T}"/> to compare.</param> 2087/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/> 2089public static Tensor<bool> LessThanOrEqual<T>(T x, in ReadOnlyTensorSpan<T> y) 2092Tensor<bool> result = Tensor.Create<bool>(y.Lengths, false); 2098/// Compares the elements of a <see cref="Tensor{T}"/> to see which elements are less than <paramref name="y"/>. 2099/// 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"/> 2102/// <param name="x"><see cref="Tensor{T}"/> to compare.</param> 2105/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/> 2639/// If <paramref name="tensor"/> is a 1D tensor, it will return <paramref name="tensor"/>. Otherwise it creates a new <see cref="Tensor{T}"/> 2642/// <param name="tensor">Input <see cref="Tensor{T}"/></param> 2644public static Tensor<T> PermuteDimensions<T>(this Tensor<T> tensor, params ReadOnlySpan<int> dimensions) 2654Tensor<T> outTensor; 2729/// <param name="tensor"><see cref="Tensor{T}"/> you want to reshape.</param> 2731public static Tensor<T> Reshape<T>(this Tensor<T> tensor, params ReadOnlySpan<nint> lengths) 2935/// 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 2938/// <param name="tensor">Input <see cref="Tensor{T}"/>.</param> 2940public static Tensor<T> Resize<T>(Tensor<T> tensor, ReadOnlySpan<nint> lengths) 2944Tensor<T> output = new Tensor<T>(values, lengths, false); 2959/// <param name="tensor">Input <see cref="Tensor{T}"/>.</param> 2961public static void ResizeTo<T>(scoped in Tensor<T> tensor, in TensorSpan<T> destination) 3008/// <param name="tensor">Input <see cref="Tensor{T}"/>.</param> 3009public static Tensor<T> Reverse<T>(in ReadOnlyTensorSpan<T> tensor) 3011Tensor<T> output = Tensor.Create<T>(tensor.Lengths); 3021/// <param name="tensor">Input <see cref="Tensor{T}"/>.</param> 3023public static Tensor<T> ReverseDimension<T>(in ReadOnlyTensorSpan<T> tensor, int dimension) 3025Tensor<T> output = Tensor.Create<T>(tensor.Lengths); 3145/// <param name="tensor">Input <see cref="Tensor{T}"/>.</param> 3148public static Tensor<T> SetSlice<T>(this Tensor<T> tensor, in ReadOnlyTensorSpan<T> values, params ReadOnlySpan<NRange> ranges) 3158/// <param name="tensor">Input <see cref="Tensor{T}"/>.</param> 3187/// Split a <see cref="Tensor{T}"/> into <paramref name="splitCount"/> along the given <paramref name="dimension"/>. If the tensor cannot be split 3190/// <param name="tensor">Input <see cref="Tensor{T}"/>.</param> 3193public static Tensor<T>[] Split<T>(scoped in ReadOnlyTensorSpan<T> tensor, int splitCount, nint dimension) 3198Tensor<T>[] outputs = new Tensor<T>[splitCount]; 3267/// <param name="tensor">The <see cref="Tensor{T}"/> to remove all dimensions of length 1.</param> 3268public static Tensor<T> Squeeze<T>(this Tensor<T> tensor) 3277/// <param name="tensor">The <see cref="Tensor{T}"/> to remove dimension of length 1.</param> 3279public static Tensor<T> SqueezeDimension<T>(this Tensor<T> tensor, int dimension) 3435/// Join multiple <see cref="Tensor{T}"/> along a new dimension that is added at position 0. All tensors must have the same shape. 3437/// <param name="tensors">Input <see cref="Tensor{T}"/>.</param> 3438public static Tensor<T> Stack<T>(params ReadOnlySpan<Tensor<T>> tensors) 3444/// 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. 3446/// <param name="tensors">Input <see cref="Tensor{T}"/>.</param> 3448public static Tensor<T> StackAlongDimension<T>(int dimension, params ReadOnlySpan<Tensor<T>> tensors) 3462Tensor<T>[] outputs = new Tensor<T>[tensors.Length]; 3471/// Join multiple <see cref="Tensor{T}"/> along a new dimension that is added at position 0. All tensors must have the same shape. 3473/// <param name="tensors">Input <see cref="Tensor{T}"/>.</param> 3475public static ref readonly TensorSpan<T> Stack<T>(scoped in ReadOnlySpan<Tensor<T>> tensors, in TensorSpan<T> destination) 3481/// 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. 3483/// <param name="tensors">Input <see cref="Tensor{T}"/>.</param> 3486public static ref readonly TensorSpan<T> StackAlongDimension<T>(scoped ReadOnlySpan<Tensor<T>> tensors, in TensorSpan<T> destination, int dimension) 3500Tensor<T>[] outputs = new Tensor<T>[tensors.Length]; 3587/// Creates a <see cref="string"/> representation of the <see cref="Tensor{T}"/>."/> 3592public static string ToString<T>(this Tensor<T> tensor, params ReadOnlySpan<nint> maximumLengths) => ((ReadOnlyTensorSpan<T>)tensor).ToString(maximumLengths); 3600/// <param name="tensor">Input <see cref="Tensor{T}"/>.</param> 3601public static Tensor<T> Transpose<T>(Tensor<T> tensor) 3618/// <param name="tensor">Input <see cref="Tensor{T}"/>.</param> 3620public static bool TryBroadcastTo<T>(this Tensor<T> tensor, in TensorSpan<T> destination) 3660/// <param name="tensor">The <see cref="Tensor{T}"/> to add a dimension of length 1.</param> 3662public static Tensor<T> Unsqueeze<T>(this Tensor<T> tensor, int dimension) 3733/// Takes the absolute value of each element of the <see cref="Tensor{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 3736public static Tensor<T> Abs<T>(in ReadOnlyTensorSpan<T> x) 3739Tensor<T> output = Tensor.Create<T>(x.Lengths); 3758/// Takes the inverse cosine of each element of the <see cref="Tensor{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 3761public static Tensor<T> Acos<T>(in ReadOnlyTensorSpan<T> x) 3764Tensor<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. 3783/// 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. 3786public static Tensor<T> Acosh<T>(in ReadOnlyTensorSpan<T> x) 3789Tensor<T> output = Tensor.Create<T>(x.Lengths); 3808/// 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. 3811public static Tensor<T> AcosPi<T>(in ReadOnlyTensorSpan<T> x) 3814Tensor<T> output = Tensor.Create<T>(x.Lengths); 3833/// 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. 3837public static Tensor<T> Add<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 3840Tensor<T> output; 3855/// Adds <paramref name="y"/> to each element of <paramref name="x"/> and returns a new <see cref="Tensor{T}"/> with the result. 3859public static Tensor<T> Add<T>(in ReadOnlyTensorSpan<T> x, T y) 3862Tensor<T> output = Tensor.Create<T>(x.Lengths); 3894/// Takes the inverse sin of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 3897public static Tensor<T> Asin<T>(in ReadOnlyTensorSpan<T> x) 3900Tensor<T> output = Tensor.Create<T>(x.Lengths); 3919/// 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. 3922public static Tensor<T> Asinh<T>(in ReadOnlyTensorSpan<T> x) 3925Tensor<T> output = Tensor.Create<T>(x.Lengths); 3944/// 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. 3947public static Tensor<T> AsinPi<T>(in ReadOnlyTensorSpan<T> x) 3950Tensor<T> output = Tensor.Create<T>(x.Lengths); 3969/// Takes the arc tangent of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 3972public static Tensor<T> Atan<T>(in ReadOnlyTensorSpan<T> x) 3975Tensor<T> output = Tensor.Create<T>(x.Lengths); 3994/// Takes the arc tangent of the two input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 3998public static Tensor<T> Atan2<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 4001Tensor<T> output; 4028/// Takes the arc tangent of the two input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 4032public static Tensor<T> Atan2<T>(in ReadOnlyTensorSpan<T> x, T y) 4035Tensor<T> output = Tensor.Create<T>(x.Lengths); 4054/// Takes the arc tangent of the two input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 4058public static Tensor<T> Atan2<T>(T x, in ReadOnlyTensorSpan<T> y) 4061Tensor<T> output = Tensor.Create<T>(y.Lengths); 4082/// 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. 4086public static Tensor<T> Atan2Pi<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 4089Tensor<T> output; 4120public static Tensor<T> Atan2Pi<T>(in ReadOnlyTensorSpan<T> x, T y) 4123Tensor<T> output = Tensor.Create<T>(x.Lengths); 4146public static Tensor<T> Atan2Pi<T>(T x, in ReadOnlyTensorSpan<T> y) 4149Tensor<T> output = Tensor.Create<T>(y.Lengths); 4171/// 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. 4174public static Tensor<T> Atanh<T>(in ReadOnlyTensorSpan<T> x) 4177Tensor<T> output = Tensor.Create<T>(x.Lengths); 4196/// 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. 4199public static Tensor<T> AtanPi<T>(in ReadOnlyTensorSpan<T> x) 4202Tensor<T> output = Tensor.Create<T>(x.Lengths); 4221/// 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. 4225public static Tensor<T> BitwiseAnd<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 4228Tensor<T> output; 4255/// 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. 4259public static Tensor<T> BitwiseAnd<T>(in ReadOnlyTensorSpan<T> x, T y) 4262Tensor<T> output = Tensor.Create<T>(x.Lengths); 4283/// 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. 4287public static Tensor<T> BitwiseOr<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 4290Tensor<T> output; 4317/// 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. 4321public static Tensor<T> BitwiseOr<T>(in ReadOnlyTensorSpan<T> x, T y) 4324Tensor<T> output = Tensor.Create<T>(x.Lengths); 4345/// Computes the element-wise cube root of the input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 4348public static Tensor<T> Cbrt<T>(in ReadOnlyTensorSpan<T> x) 4351Tensor<T> output = Tensor.Create<T>(x.Lengths); 4370/// Computes the element-wise ceiling of the input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 4373public static Tensor<T> Ceiling<T>(in ReadOnlyTensorSpan<T> x) 4376Tensor<T> output = Tensor.Create<T>(x.Lengths); 4399public static Tensor<TTo> ConvertChecked<TFrom, TTo>(in ReadOnlyTensorSpan<TFrom> source) 4403Tensor<TTo> output = Tensor.Create<TTo>(source.Lengths); 4429public static Tensor<TTo> ConvertSaturating<TFrom, TTo>(in ReadOnlyTensorSpan<TFrom> source) 4433Tensor<TTo> output = Tensor.Create<TTo>(source.Lengths); 4459public static Tensor<TTo> ConvertTruncating<TFrom, TTo>(in ReadOnlyTensorSpan<TFrom> source) 4463Tensor<TTo> output = Tensor.Create<TTo>(source.Lengths); 4489public static Tensor<T> CopySign<T>(in ReadOnlyTensorSpan<T> x, T sign) 4492Tensor<T> output = Create<T>(x.Lengths); 4499/// 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. 4503public static Tensor<T> CopySign<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> sign) 4506Tensor<T> output; 4547/// Takes the cosine of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 4550public static Tensor<T> Cos<T>(in ReadOnlyTensorSpan<T> x) 4553Tensor<T> output = Tensor.Create<T>(x.Lengths); 4572/// Takes the hyperbolic 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> Cosh<T>(in ReadOnlyTensorSpan<T> x) 4578Tensor<T> output = Tensor.Create<T>(x.Lengths); 4601public static Tensor<T> CosineSimilarity<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 4618Tensor<T> output = Tensor.Create<T>(values, [dim1, dim2]); 4678/// <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> 4692public static Tensor<T> CosPi<T>(in ReadOnlyTensorSpan<T> x) 4695Tensor<T> output = Tensor.Create<T>(x.Lengths); 4727public static Tensor<T> DegreesToRadians<T>(in ReadOnlyTensorSpan<T> x) 4730Tensor<T> output = Tensor.Create<T>(x.Lengths); 4762/// Divides each element of <paramref name="x"/> by <paramref name="y"/> and returns a new <see cref="Tensor{T}"/> with the result. 4766public static Tensor<T> Divide<T>(in ReadOnlyTensorSpan<T> x, T y) 4769Tensor<T> output = Create<T>(x.Lengths); 4775/// Divides <paramref name="x"/> by each element of <paramref name="y"/> and returns a new <see cref="Tensor{T}"/> with the result."/> 4779public static Tensor<T> Divide<T>(T x, in ReadOnlyTensorSpan<T> y) 4782Tensor<T> output = Tensor.Create<T>(y.Lengths); 4793public static Tensor<T> Divide<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 4796Tensor<T> output; 4866public static Tensor<T> Exp<T>(in ReadOnlyTensorSpan<T> x) 4869Tensor<T> output = Tensor.Create<T>(x.Lengths); 4891public static Tensor<T> Exp10<T>(in ReadOnlyTensorSpan<T> x) 4894Tensor<T> output = Tensor.Create<T>(x.Lengths); 4914public static Tensor<T> Exp10M1<T>(in ReadOnlyTensorSpan<T> x) 4917Tensor<T> output = Tensor.Create<T>(x.Lengths); 4935public static Tensor<T> Exp2<T>(in ReadOnlyTensorSpan<T> x) 4938Tensor<T> output = Tensor.Create<T>(x.Lengths); 4956public static Tensor<T> Exp2M1<T>(in ReadOnlyTensorSpan<T> x) 4959Tensor<T> output = Tensor.Create<T>(x.Lengths); 4977public static Tensor<T> ExpM1<T>(in ReadOnlyTensorSpan<T> x) 4980Tensor<T> output = Tensor.Create<T>(x.Lengths); 4998public static Tensor<T> Floor<T>(in ReadOnlyTensorSpan<T> x) 5001Tensor<T> output = Tensor.Create<T>(x.Lengths); 5023public static Tensor<T> Hypot<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 5026Tensor<T> output; 5059public static Tensor<T> Ieee754Remainder<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 5062Tensor<T> output; 5090public static Tensor<T> Ieee754Remainder<T>(in ReadOnlyTensorSpan<T> x, T y) 5093Tensor<T> output = Tensor.Create<T>(x.Lengths); 5112public static Tensor<T> Ieee754Remainder<T>(T x, in ReadOnlyTensorSpan<T> y) 5115Tensor<T> output = Tensor.Create<T>(y.Lengths); 5135public static Tensor<int> ILogB<T>(in ReadOnlyTensorSpan<T> x) 5138Tensor<int> output = Tensor.Create<int>(x.Lengths, x.Strides); 5204public static Tensor<T> LeadingZeroCount<T>(in ReadOnlyTensorSpan<T> x) 5207Tensor<T> output = Tensor.Create<T>(x.Lengths); 5226/// Takes the natural logarithm of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 5229public static Tensor<T> Log<T>(in ReadOnlyTensorSpan<T> x) 5232Tensor<T> output = Tensor.Create<T>(x.Lengths); 5251public static Tensor<T> Log<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 5254Tensor<T> output; 5281public static Tensor<T> Log<T>(in ReadOnlyTensorSpan<T> x, T y) 5284Tensor<T> output = Tensor.Create<T>(x.Lengths); 5303/// 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. 5306public static Tensor<T> Log10<T>(in ReadOnlyTensorSpan<T> x) 5309Tensor<T> output = Tensor.Create<T>(x.Lengths); 5328/// 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. 5331public static Tensor<T> Log10P1<T>(in ReadOnlyTensorSpan<T> x) 5334Tensor<T> output = Tensor.Create<T>(x.Lengths); 5353/// 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. 5356public static Tensor<T> Log2<T>(in ReadOnlyTensorSpan<T> x) 5359Tensor<T> output = Tensor.Create<T>(x.Lengths); 5378/// 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. 5381public static Tensor<T> Log2P1<T>(in ReadOnlyTensorSpan<T> x) 5384Tensor<T> output = Tensor.Create<T>(x.Lengths); 5403/// 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. 5406public static Tensor<T> LogP1<T>(in ReadOnlyTensorSpan<T> x) 5409Tensor<T> output = Tensor.Create<T>(x.Lengths); 5438public static Tensor<T> Max<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 5441Tensor<T> output; 5468public static Tensor<T> Max<T>(in ReadOnlyTensorSpan<T> x, T y) 5471Tensor<T> output = Tensor.Create<T>(x.Lengths); 5499public static Tensor<T> MaxMagnitude<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 5502Tensor<T> output; 5529public static Tensor<T> MaxMagnitude<T>(in ReadOnlyTensorSpan<T> x, T y) 5532Tensor<T> output = Tensor.Create<T>(x.Lengths); 5560public static Tensor<T> MaxMagnitudeNumber<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 5563Tensor<T> output; 5590public static Tensor<T> MaxMagnitudeNumber<T>(in ReadOnlyTensorSpan<T> x, T y) 5593Tensor<T> output = Tensor.Create<T>(x.Lengths); 5621public static Tensor<T> MaxNumber<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 5624Tensor<T> output; 5651public static Tensor<T> MaxNumber<T>(in ReadOnlyTensorSpan<T> x, T y) 5654Tensor<T> output = Tensor.Create<T>(x.Lengths); 5682public static Tensor<T> Min<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 5685Tensor<T> output; 5712public static Tensor<T> Min<T>(in ReadOnlyTensorSpan<T> x, T y) 5715Tensor<T> output = Tensor.Create<T>(x.Lengths); 5743public static Tensor<T> MinMagnitude<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 5746Tensor<T> output; 5773public static Tensor<T> MinMagnitude<T>(in ReadOnlyTensorSpan<T> x, T y) 5776Tensor<T> output = Tensor.Create<T>(x.Lengths); 5804public static Tensor<T> MinMagnitudeNumber<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 5807Tensor<T> output; 5834public static Tensor<T> MinMagnitudeNumber<T>(in ReadOnlyTensorSpan<T> x, T y) 5837Tensor<T> output = Tensor.Create<T>(x.Lengths); 5865public static Tensor<T> MinNumber<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 5868Tensor<T> output; 5895public static Tensor<T> MinNumber<T>(in ReadOnlyTensorSpan<T> x, T y) 5898Tensor<T> output = Tensor.Create<T>(x.Lengths); 5916/// Multiplies each element of <paramref name="x"/> with <paramref name="y"/> and returns a new <see cref="Tensor{T}"/> with the result. 5920public static Tensor<T> Multiply<T>(in ReadOnlyTensorSpan<T> x, T y) 5923Tensor<T> output = Tensor.Create<T>(x.Lengths); 5929/// Multiplies each element of <paramref name="x"/> with <paramref name="y"/> and returns a new <see cref="Tensor{T}"/> with the result. 5934public static Tensor<T> Multiply<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 5937Tensor<T> output; 5983public static Tensor<T> Negate<T>(in ReadOnlyTensorSpan<T> x) 5986Tensor<T> output = Tensor.Create<T>(x.Lengths); 6016public static Tensor<T> OnesComplement<T>(in ReadOnlyTensorSpan<T> x) 6019Tensor<T> output = Tensor.Create<T>(x.Lengths); 6037public static Tensor<T> PopCount<T>(in ReadOnlyTensorSpan<T> x) 6040Tensor<T> output = Tensor.Create<T>(x.Lengths); 6059public static Tensor<T> Pow<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 6062Tensor<T> output; 6089public static Tensor<T> Pow<T>(in ReadOnlyTensorSpan<T> x, T y) 6092Tensor<T> output = Tensor.Create<T>(x.Lengths); 6111public static Tensor<T> Pow<T>(T x, in ReadOnlyTensorSpan<T> y) 6114Tensor<T> output = Tensor.Create<T>(y.Lengths); 6144public static Tensor<T> RadiansToDegrees<T>(in ReadOnlyTensorSpan<T> x) 6147Tensor<T> output = Tensor.Create<T>(x.Lengths); 6165public static Tensor<T> Reciprocal<T>(in ReadOnlyTensorSpan<T> x) 6168Tensor<T> output = Tensor.Create<T>(x.Lengths); 6187public static Tensor<T> RootN<T>(in ReadOnlyTensorSpan<T> x, int n) 6190Tensor<T> output = Tensor.Create<T>(x.Lengths); 6217public static Tensor<T> RotateLeft<T>(in ReadOnlyTensorSpan<T> x, int rotateAmount) 6220Tensor<T> output = Tensor.Create<T>(x.Lengths); 6248public static Tensor<T> RotateRight<T>(in ReadOnlyTensorSpan<T> x, int rotateAmount) 6251Tensor<T> output = Tensor.Create<T>(x.Lengths); 6277public static Tensor<T> Round<T>(in ReadOnlyTensorSpan<T> x) 6280Tensor<T> output = Tensor.Create<T>(x.Lengths); 6298public static Tensor<T> Round<T>(in ReadOnlyTensorSpan<T> x, int digits, MidpointRounding mode) 6301Tensor<T> output = Tensor.Create<T>(x.Lengths); 6326public static Tensor<T> Round<T>(in ReadOnlyTensorSpan<T> x, int digits) 6329Tensor<T> output = Tensor.Create<T>(x.Lengths); 6353public static Tensor<T> Round<T>(in ReadOnlyTensorSpan<T> x, MidpointRounding mode) 6356Tensor<T> output = Tensor.Create<T>(x.Lengths); 6381public static Tensor<T> Sigmoid<T>(in ReadOnlyTensorSpan<T> x) 6384Tensor<T> output = Tensor.Create<T>(x.Lengths); 6401/// Takes the sin of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 6404public static Tensor<T> Sin<T>(in ReadOnlyTensorSpan<T> x) 6407Tensor<T> output = Tensor.Create<T>(x.Lengths); 6427public static Tensor<T> Sinh<T>(in ReadOnlyTensorSpan<T> x) 6430Tensor<T> output = Tensor.Create<T>(x.Lengths); 6448public static Tensor<T> SinPi<T>(in ReadOnlyTensorSpan<T> x) 6451Tensor<T> output = Tensor.Create<T>(x.Lengths); 6469public static Tensor<T> SoftMax<T>(in ReadOnlyTensorSpan<T> x) 6472Tensor<T> output = Tensor.Create<T>(x.Lengths); 6489/// Takes the square root of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 6492public static Tensor<T> Sqrt<T>(in ReadOnlyTensorSpan<T> x) 6495Tensor<T> output = Tensor.Create<T>(x.Lengths); 6514/// Subtracts <paramref name="y"/> from each element of <paramref name="x"/> and returns a new <see cref="Tensor{T}"/> with the result. 6518public static Tensor<T> Subtract<T>(in ReadOnlyTensorSpan<T> x, T y) 6521Tensor<T> output = Create<T>(x.Lengths); 6527/// Subtracts each element of <paramref name="y"/> from <paramref name="x"/> and returns a new <see cref="Tensor{T}"/> with the result. 6531public static Tensor<T> Subtract<T>(T x, in ReadOnlyTensorSpan<T> y) 6534Tensor<T> output = Create<T>(y.Lengths); 6540/// Subtracts each element of <paramref name="x"/> from <paramref name="y"/> and returns a new <see cref="Tensor{T}"/> with the result. 6544public static Tensor<T> Subtract<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 6547Tensor<T> output; 6614public static Tensor<T> Tan<T>(in ReadOnlyTensorSpan<T> x) 6617Tensor<T> output = Tensor.Create<T>(x.Lengths); 6635public static Tensor<T> Tanh<T>(in ReadOnlyTensorSpan<T> x) 6638Tensor<T> output = Tensor.Create<T>(x.Lengths); 6656public static Tensor<T> TanPi<T>(in ReadOnlyTensorSpan<T> x) 6659Tensor<T> output = Tensor.Create<T>(x.Lengths); 6677public static Tensor<T> TrailingZeroCount<T>(in ReadOnlyTensorSpan<T> x) 6680Tensor<T> output = Tensor.Create<T>(x.Lengths); 6698public static Tensor<T> Truncate<T>(in ReadOnlyTensorSpan<T> x) 6701Tensor<T> output = Tensor.Create<T>(x.Lengths); 6720public static Tensor<T> Xor<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 6723Tensor<T> output; 6748/// Computes the element-wise Xor of the two input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 6752public static Tensor<T> Xor<T>(in ReadOnlyTensorSpan<T> x, T y) 6755Tensor<T> output = Tensor.Create<T>(x.Lengths);
System\Numerics\Tensors\netcore\TensorHelpers.cs (4)
33internal static bool IsBroadcastableTo<T>(Tensor<T> tensor1, Tensor<T> tensor2) 94internal static bool IsUnderlyingStorageSameSize<T>(Tensor<T> tensor1, Tensor<T> tensor2)