20 instantiations of Tensor
System.Numerics.Tensors (20)
System\Numerics\Tensors\netcore\Tensor_1.cs (4)
21public static Tensor<T> Empty { get; } = new(); 228return new Tensor<T>( 243return new Tensor<T>( 258return new Tensor<T>(
System\Numerics\Tensors\netcore\Tensor.cs (16)
409=> new Tensor<T>(array); 414=> new Tensor<T>(array, lengths, strides: []); 419=> new Tensor<T>(array, lengths, strides); 424=> new Tensor<T>(array, start, lengths, strides); 431=> new Tensor<T>(lengths, strides: [], pinned); 436=> new Tensor<T>(lengths, strides, pinned); 447return new Tensor<T>(values, in shape); 1504Tensor<T> result = new Tensor<T>(tensor._values, tensor._start, newLengths, newStrides, tensor.IsPinned); 1623return new Tensor<T>(tensor._values, tensor._start, reshaped._shape); 1636Tensor<T> result = new Tensor<T>(tensor._values, tensor._start, newLengths, strides, tensor.IsPinned); 2161outputs[i] = new Tensor<T>(values, newLengths, strides: []); 2245Tensor<T> output = new Tensor<T>(tensor._values, tensor._start, lengths[..rank], strides[..rank], tensor.IsPinned); 2496tensor = new Tensor<T>(tensor._values, tensor._start, TensorShape.WithRank(tensor._shape, rank)); 2681Tensor<T> output = new Tensor<T>(tensor._values, tensor._start, lengths, strides, tensor.IsPinned); 2742return new Tensor<T>(tensor._values, tensor._start, unsqueezed._shape); 2776Tensor<T> output = new Tensor<T>(tensor._values, tensor._start, newLengths, newStrides, tensor.IsPinned);
609 references to Tensor
System.Numerics.Tensors (609)
System\Numerics\Tensors\netcore\ReadOnlyTensorSpan_1.cs (1)
534Tensor<T> tmp = Tensor.CreateFromShape<T>(Lengths, IsPinned);
System\Numerics\Tensors\netcore\Tensor_1.cs (27)
18public sealed class Tensor<T> : ITensor<Tensor<T>, T>, IEnumerable<T> 21public static Tensor<T> Empty { get; } = new(); 96public Tensor<T> this[params ReadOnlySpan<NRange> ranges] 129public static implicit operator Tensor<T>(T[] array) => Tensor.Create(array); 134public static implicit operator TensorSpan<T>(Tensor<T> tensor) => tensor.AsTensorSpan(); 137public static implicit operator ReadOnlyTensorSpan<T>(Tensor<T> tensor) => tensor.AsReadOnlyTensorSpan(); 221public Tensor<T> Slice(params ReadOnlySpan<nint> startIndexes) 236public Tensor<T> Slice(params ReadOnlySpan<NIndex> startIndexes) 251public Tensor<T> Slice(params ReadOnlySpan<NRange> ranges) 266public Tensor<T> ToDenseTensor() 268Tensor<T> result = this; 327ref readonly T IReadOnlyTensor<Tensor<T>, T>.this[params ReadOnlySpan<nint> indexes] => ref this[indexes]; 329ref readonly T IReadOnlyTensor<Tensor<T>, T>.this[params ReadOnlySpan<NIndex> indexes] => ref this[indexes]; 331ReadOnlyTensorDimensionSpan<T> IReadOnlyTensor<Tensor<T>, T>.GetDimensionSpan(int dimension) => AsReadOnlyTensorSpan().GetDimensionSpan(dimension); 333ref readonly T IReadOnlyTensor<Tensor<T>, T>.GetPinnableReference() => ref GetPinnableReference(); 335ReadOnlySpan<T> IReadOnlyTensor<Tensor<T>, T>.GetSpan(scoped ReadOnlySpan<nint> startIndexes, int length) => AsReadOnlyTensorSpan().GetSpan(startIndexes, length); 337ReadOnlySpan<T> IReadOnlyTensor<Tensor<T>, T>.GetSpan(scoped ReadOnlySpan<NIndex> startIndexes, int length) => AsReadOnlyTensorSpan().GetSpan(startIndexes, length); 371static Tensor<T> ITensor<Tensor<T>, T>.CreateFromShape(scoped ReadOnlySpan<nint> lengths, bool pinned) => Tensor.CreateFromShape<T>(lengths, pinned); 373static Tensor<T> ITensor<Tensor<T>, T>.CreateFromShape(scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides, bool pinned) => Tensor.CreateFromShape<T>(lengths, strides, pinned); 375static Tensor<T> ITensor<Tensor<T>, T>.CreateFromShapeUninitialized(scoped ReadOnlySpan<nint> lengths, bool pinned) => Tensor.CreateFromShapeUninitialized<T>(lengths, pinned); 377static Tensor<T> ITensor<Tensor<T>, T>.CreateFromShapeUninitialized(scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides, bool pinned) => Tensor.CreateFromShapeUninitialized<T>(lengths, strides, pinned); 382private readonly Tensor<T> _tensor; 387internal Enumerator(Tensor<T> tensor)
System\Numerics\Tensors\netcore\Tensor.cs (402)
52/// Broadcast the data from <paramref name="source"/> to the smallest broadcastable shape compatible with <paramref name="lengthsSource"/>. Creates a new <see cref="Tensor{T}"/> and allocates new memory. 54/// <param name="source">Input <see cref="Tensor{T}"/>.</param> 55/// <param name="lengthsSource">Other <see cref="Tensor{T}"/> to make shapes broadcastable.</param> 57public static Tensor<T> Broadcast<T>(scoped in ReadOnlyTensorSpan<T> source, scoped in ReadOnlyTensorSpan<T> lengthsSource) 63/// Broadcast the data from <paramref name="source"/> to the new shape <paramref name="lengths"/>. Creates a new <see cref="Tensor{T}"/> and allocates new memory. 66/// <param name="source">Input <see cref="Tensor{T}"/>.</param> 70public static Tensor<T> Broadcast<T>(scoped in ReadOnlyTensorSpan<T> source, scoped ReadOnlySpan<nint> lengths) 73Tensor<T> destination = CreateFromShapeUninitialized<T>(lengths); 85public static void BroadcastTo<T>(this Tensor<T> source, in TensorSpan<T> destination) 118public static Tensor<T> Concatenate<T>(params scoped ReadOnlySpan<Tensor<T>> tensors) 129public static Tensor<T> ConcatenateOnDimension<T>(int dimension, params scoped ReadOnlySpan<Tensor<T>> tensors) 143Tensor<T> tensor; 176public static ref readonly TensorSpan<T> Concatenate<T>(scoped ReadOnlySpan<Tensor<T>> tensors, in TensorSpan<T> destination) 188public static ref readonly TensorSpan<T> ConcatenateOnDimension<T>(int dimension, scoped ReadOnlySpan<Tensor<T>> tensors, in TensorSpan<T> destination) 239private static Tensor<T> CreateConcatenationResult<T>(ReadOnlySpan<nint> sourceLengths, int dimension, nint axisLength) 243Tensor<T> result; 258private static void ValidateConcatenationStorage<T>(scoped ReadOnlySpan<Tensor<T>> tensors, in TensorSpan<T> destination) 281private static void CopyConcatenatedValues<T>(int dimension, scoped ReadOnlySpan<Tensor<T>> tensors, 303foreach (Tensor<T> tensor in tensors) 305Tensor<T>.Enumerator input = tensor.GetEnumerator(); 320foreach (Tensor<T> tensor in tensors) 342private static nint GetConcatenatedLength<T>(int dimension, scoped ReadOnlySpan<Tensor<T>> tensors, in TensorShape shape) 360private static void ConcatenateOnDimensionToSpan<T>(int dimension, scoped ReadOnlySpan<Tensor<T>> tensors, in TensorSpan<T> destination, Span<T> dstSpan) 408public static Tensor<T> Create<T>(T[] array) 413public static Tensor<T> Create<T>(T[] array, scoped ReadOnlySpan<nint> lengths) 418public static Tensor<T> Create<T>(T[] array, scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides) 423public static Tensor<T> Create<T>(T[] array, int start, scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides) 430public static Tensor<T> CreateFromShape<T>(scoped ReadOnlySpan<nint> lengths, bool pinned = false) 435public static Tensor<T> CreateFromShape<T>(scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides, bool pinned = false) 439public static Tensor<T> CreateFromShapeUninitialized<T>(scoped ReadOnlySpan<nint> lengths, bool pinned = false) 443public static Tensor<T> CreateFromShapeUninitialized<T>(scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides, bool pinned = false) 574public static Tensor<bool> Equals<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 577TensorOperation.ValidateCompatibility(x, y, out Tensor<bool> destination); 605public static Tensor<bool> Equals<T>(in ReadOnlyTensorSpan<T> x, T y) 608Tensor<bool> destination = CreateFromShapeUninitialized<bool>(x.Lengths); 694/// <param name="tensor">Input <see cref="Tensor{T}"/>.</param> 708/// <param name="tensor">Input <see cref="Tensor{T}"/>.</param> 723/// 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"/> 728/// <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 730public static Tensor<bool> GreaterThan<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 733TensorOperation.ValidateCompatibility(x, y, out Tensor<bool> destination); 741/// 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"/> 747/// <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 759/// 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"/> 764/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/> 766public static Tensor<bool> GreaterThan<T>(in ReadOnlyTensorSpan<T> x, T y) 769Tensor<bool> destination = CreateFromShape<bool>(x.Lengths, false); 776/// 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"/> 782/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/> 794/// It returns a <see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/> 799/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/> 801public static Tensor<bool> GreaterThan<T>(T x, in ReadOnlyTensorSpan<T> y) 806/// 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"/> 812/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/> 904/// It returns a <see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/> 909/// <returns>A <see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/> and 911public static Tensor<bool> GreaterThanOrEqual<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 914TensorOperation.ValidateCompatibility(x, y, out Tensor<bool> destination); 922/// 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"/> 928/// <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 940/// 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"/> 945/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/> 947public static Tensor<bool> GreaterThanOrEqual<T>(in ReadOnlyTensorSpan<T> x, T y) 950Tensor<bool> destination = CreateFromShape<bool>(x.Lengths, false); 957/// 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"/> 963/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/> 975/// 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"/> 980/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/> 982public static Tensor<bool> GreaterThanOrEqual<T>(T x, in ReadOnlyTensorSpan<T> y) 987/// 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"/> 993/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are greater than <paramref name="y"/> 1085/// 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"/> 1090/// <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 1092public static Tensor<bool> LessThan<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 1095TensorOperation.ValidateCompatibility(x, y, out Tensor<bool> destination); 1103/// 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"/> 1109/// <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 1120/// Compares the elements of a <see cref="Tensor{T}"/> to see which elements are less than <paramref name="y"/>. 1121/// 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"/> 1124/// <param name="x"><see cref="Tensor{T}"/> to compare.</param> 1126/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/> 1128public static Tensor<bool> LessThan<T>(in ReadOnlyTensorSpan<T> x, T y) 1131Tensor<bool> destination = CreateFromShape<bool>(x.Lengths, false); 1137/// Compares the elements of a <see cref="Tensor{T}"/> to see which elements are less than <paramref name="y"/>. 1138/// 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"/> 1141/// <param name="x"><see cref="Tensor{T}"/> to compare.</param> 1144/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/> 1155/// Compares the elements of a <see cref="Tensor{T}"/> to see which elements are less than <paramref name="y"/>. 1156/// 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"/> 1159/// <param name="x"><see cref="Tensor{T}"/> to compare.</param> 1161/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/> 1163public static Tensor<bool> LessThan<T>(T x, in ReadOnlyTensorSpan<T> y) 1167/// Compares the elements of a <see cref="Tensor{T}"/> to see which elements are less than <paramref name="y"/>. 1168/// It returns a <see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/> 1171/// <param name="x"><see cref="Tensor{T}"/> to compare.</param> 1174/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/> 1266/// 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"/> 1271/// <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 1273public static Tensor<bool> LessThanOrEqual<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 1276TensorOperation.ValidateCompatibility(x, y, out Tensor<bool> destination); 1284/// 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"/> 1290/// <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 1301/// Compares the elements of a <see cref="Tensor{T}"/> to see which elements are less than <paramref name="y"/>. 1302/// 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"/> 1305/// <param name="x"><see cref="Tensor{T}"/> to compare.</param> 1307/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/> 1309public static Tensor<bool> LessThanOrEqual<T>(in ReadOnlyTensorSpan<T> x, T y) 1312Tensor<bool> destination = CreateFromShape<bool>(x.Lengths, false); 1318/// Compares the elements of a <see cref="Tensor{T}"/> to see which elements are less than <paramref name="y"/>. 1319/// 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"/> 1322/// <param name="x"><see cref="Tensor{T}"/> to compare.</param> 1325/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/> 1336/// Compares the elements of a <see cref="Tensor{T}"/> to see which elements are less than <paramref name="y"/>. 1337/// 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"/> 1340/// <param name="x"><see cref="Tensor{T}"/> to compare.</param> 1342/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/> 1344public static Tensor<bool> LessThanOrEqual<T>(T x, in ReadOnlyTensorSpan<T> y) 1348/// Compares the elements of a <see cref="Tensor{T}"/> to see which elements are less than <paramref name="y"/>. 1349/// It returns a <see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/> 1352/// <param name="x"><see cref="Tensor{T}"/> to compare.</param> 1355/// <returns><see cref="Tensor{Boolean}"/> where the value is true if the elements in <paramref name="x"/> are less than <paramref name="y"/> 1447/// If <paramref name="tensor"/> is a 1D tensor, it will return <paramref name="tensor"/>. Otherwise it creates a new <see cref="Tensor{T}"/> 1450/// <param name="tensor">Input <see cref="Tensor{T}"/></param> 1452public static Tensor<T> PermuteDimensions<T>(this Tensor<T> tensor, ReadOnlySpan<int> dimensions) 1504Tensor<T> result = new Tensor<T>(tensor._values, tensor._start, newLengths, newStrides, tensor.IsPinned); 1611/// <param name="tensor"><see cref="Tensor{T}"/> you want to reshape.</param> 1613public static Tensor<T> Reshape<T>(this Tensor<T> tensor, ReadOnlySpan<nint> lengths) 1636Tensor<T> result = new Tensor<T>(tensor._values, tensor._start, newLengths, strides, tensor.IsPinned); 1710/// 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 1713/// <param name="tensor">Input <see cref="Tensor{T}"/>.</param> 1715public static Tensor<T> Resize<T>(Tensor<T> tensor, ReadOnlySpan<nint> lengths) 1717Tensor<T> output = CreateFromShape<T>(lengths, tensor.IsPinned); 1772/// <param name="tensor">Input <see cref="Tensor{T}"/>.</param> 1774public static void ResizeTo<T>(scoped in Tensor<T> tensor, in TensorSpan<T> destination) 1857/// <param name="tensor">Input <see cref="Tensor{T}"/>.</param> 1858public static Tensor<T> Reverse<T>(in ReadOnlyTensorSpan<T> tensor) 1860Tensor<T> output = CreateFromShape<T>(tensor.Lengths); 1870/// <param name="tensor">Input <see cref="Tensor{T}"/>.</param> 1872public static Tensor<T> ReverseDimension<T>(in ReadOnlyTensorSpan<T> tensor, int dimension) 1874Tensor<T> output = CreateFromShape<T>(tensor.Lengths); 2088/// <param name="tensor">Input <see cref="Tensor{T}"/>.</param> 2091public static Tensor<T> SetSlice<T>(this Tensor<T> tensor, in ReadOnlyTensorSpan<T> values, params ReadOnlySpan<NRange> ranges) 2100/// <param name="tensor">Input <see cref="Tensor{T}"/>.</param> 2119/// Split a <see cref="Tensor{T}"/> into <paramref name="splitCount"/> along the given <paramref name="dimension"/>. If the tensor cannot be split 2122/// <param name="tensor">Input <see cref="Tensor{T}"/>.</param> 2127public static Tensor<T>[] Split<T>(scoped in ReadOnlyTensorSpan<T> tensor, int splitCount, nint dimension) 2142Tensor<T>[] outputs = new Tensor<T>[splitCount]; 2177/// <param name="tensor">The <see cref="Tensor{T}"/> to remove all dimensions of length 1.</param> 2178public static Tensor<T> Squeeze<T>(this Tensor<T> tensor) 2187/// <param name="tensor">The <see cref="Tensor{T}"/> to remove dimension of length 1.</param> 2189public static Tensor<T> SqueezeDimension<T>(this Tensor<T> tensor, int dimension) 2245Tensor<T> output = new Tensor<T>(tensor._values, tensor._start, lengths[..rank], strides[..rank], tensor.IsPinned); 2414/// Join multiple <see cref="Tensor{T}"/> along a new dimension that is added at position 0. All tensors must have equivalent shapes. 2416/// <param name="tensors">Input <see cref="Tensor{T}"/>.</param> 2418public static Tensor<T> Stack<T>(params ReadOnlySpan<Tensor<T>> tensors) 2424/// Join multiple <see cref="Tensor{T}"/> along a new dimension. The axis parameter specifies the index of the new dimension. All tensors must have equivalent shapes. 2426/// <param name="tensors">Input <see cref="Tensor{T}"/>.</param> 2429public static Tensor<T> StackAlongDimension<T>(int dimension, params ReadOnlySpan<Tensor<T>> tensors) 2431Tensor<T>[] outputs = UnsqueezeForStack(dimension, tensors); 2433Tensor<T> result = CreateConcatenationResult<T>(lengths, dimension, outputs.Length); 2439/// Join multiple <see cref="Tensor{T}"/> along a new dimension that is added at position 0. All tensors must have equivalent shapes. 2441/// <param name="tensors">Input <see cref="Tensor{T}"/>.</param> 2444public static ref readonly TensorSpan<T> Stack<T>(scoped in ReadOnlySpan<Tensor<T>> tensors, in TensorSpan<T> destination) 2450/// Join multiple <see cref="Tensor{T}"/> along a new dimension. The axis parameter specifies the index of the new dimension. All tensors must have equivalent shapes. 2452/// <param name="tensors">Input <see cref="Tensor{T}"/>.</param> 2456public static ref readonly TensorSpan<T> StackAlongDimension<T>(scoped ReadOnlySpan<Tensor<T>> tensors, in TensorSpan<T> destination, int dimension) 2458Tensor<T>[] outputs = UnsqueezeForStack(dimension, tensors); 2466private static Tensor<T>[] UnsqueezeForStack<T>(int dimension, scoped ReadOnlySpan<Tensor<T>> tensors) 2490Tensor<T>[] outputs = new Tensor<T>[tensors.Length]; 2493Tensor<T> tensor = tensors[i]; 2661/// <param name="tensor">Input <see cref="Tensor{T}"/>.</param> 2662public static Tensor<T> Transpose<T>(Tensor<T> tensor) 2681Tensor<T> output = new Tensor<T>(tensor._values, tensor._start, lengths, strides, tensor.IsPinned); 2695/// <param name="tensor">Input <see cref="Tensor{T}"/>.</param> 2697public static bool TryBroadcastTo<T>(this Tensor<T> tensor, in TensorSpan<T> destination) 2735/// <param name="tensor">The <see cref="Tensor{T}"/> to add a dimension of length 1.</param> 2737public static Tensor<T> Unsqueeze<T>(this Tensor<T> tensor, int dimension) 2776Tensor<T> output = new Tensor<T>(tensor._values, tensor._start, newLengths, newStrides, tensor.IsPinned); 2876/// Takes the absolute value of each element of the <see cref="Tensor{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 2879public static Tensor<T> Abs<T>(in ReadOnlyTensorSpan<T> x) 2882Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 2903/// Takes the inverse cosine of each element of the <see cref="Tensor{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 2906public static Tensor<T> Acos<T>(in ReadOnlyTensorSpan<T> x) 2909Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 2915/// Takes the inverse cosine of each element of the <see cref="Tensor{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 2930/// 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. 2933public static Tensor<T> Acosh<T>(in ReadOnlyTensorSpan<T> x) 2936Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 2957/// 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. 2960public static Tensor<T> AcosPi<T>(in ReadOnlyTensorSpan<T> x) 2963Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 2984/// Takes the inverse sin of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 2987public static Tensor<T> Asin<T>(in ReadOnlyTensorSpan<T> x) 2990Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 3011/// 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. 3014public static Tensor<T> Asinh<T>(in ReadOnlyTensorSpan<T> x) 3017Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 3038/// 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. 3041public static Tensor<T> AsinPi<T>(in ReadOnlyTensorSpan<T> x) 3044Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 3065/// Takes the arc tangent of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 3068public static Tensor<T> Atan<T>(in ReadOnlyTensorSpan<T> x) 3071Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 3092/// Takes the arc tangent of the two input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 3096public static Tensor<T> Atan2<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 3099TensorOperation.ValidateCompatibility(x, y, out Tensor<T> destination); 3119/// Takes the arc tangent of the two input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 3123public static Tensor<T> Atan2<T>(in ReadOnlyTensorSpan<T> x, T y) 3126Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 3146/// Takes the arc tangent of the two input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 3150public static Tensor<T> Atan2<T>(T x, in ReadOnlyTensorSpan<T> y) 3153Tensor<T> destination = CreateFromShapeUninitialized<T>(y.Lengths); 3175/// 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. 3179public static Tensor<T> Atan2Pi<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 3182TensorOperation.ValidateCompatibility(x, y, out Tensor<T> destination); 3206public static Tensor<T> Atan2Pi<T>(in ReadOnlyTensorSpan<T> x, T y) 3209Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 3233public static Tensor<T> Atan2Pi<T>(T x, in ReadOnlyTensorSpan<T> y) 3236Tensor<T> destination = CreateFromShapeUninitialized<T>(y.Lengths); 3258/// 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. 3261public static Tensor<T> Atanh<T>(in ReadOnlyTensorSpan<T> x) 3264Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 3285/// 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. 3288public static Tensor<T> AtanPi<T>(in ReadOnlyTensorSpan<T> x) 3291Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 3329/// Computes the element-wise cube root of the input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 3332public static Tensor<T> Cbrt<T>(in ReadOnlyTensorSpan<T> x) 3335Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 3356/// Computes the element-wise ceiling of the input <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 3359public static Tensor<T> Ceiling<T>(in ReadOnlyTensorSpan<T> x) 3362Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 3387public static Tensor<TTo> ConvertChecked<TFrom, TTo>(in ReadOnlyTensorSpan<TFrom> source) 3391Tensor<TTo> destination = CreateFromShapeUninitialized<TTo>(source.Lengths); 3418public static Tensor<TTo> ConvertSaturating<TFrom, TTo>(in ReadOnlyTensorSpan<TFrom> source) 3422Tensor<TTo> destination = CreateFromShapeUninitialized<TTo>(source.Lengths); 3449public static Tensor<TTo> ConvertTruncating<TFrom, TTo>(in ReadOnlyTensorSpan<TFrom> source) 3453Tensor<TTo> destination = CreateFromShapeUninitialized<TTo>(source.Lengths); 3480public static Tensor<T> CopySign<T>(in ReadOnlyTensorSpan<T> x, T sign) 3483Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 3489/// 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. 3493public static Tensor<T> CopySign<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> sign) 3496TensorOperation.ValidateCompatibility(x, sign, out Tensor<T> destination); 3532/// Takes the cosine of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 3535public static Tensor<T> Cos<T>(in ReadOnlyTensorSpan<T> x) 3538Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 3559/// Takes the hyperbolic cosine of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 3562public static Tensor<T> Cosh<T>(in ReadOnlyTensorSpan<T> x) 3565Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 3601/// <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> 3615public static Tensor<T> CosPi<T>(in ReadOnlyTensorSpan<T> x) 3618Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 3652public static Tensor<T> DegreesToRadians<T>(in ReadOnlyTensorSpan<T> x) 3655Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 3711public static Tensor<T> Exp<T>(in ReadOnlyTensorSpan<T> x) 3714Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 3738public static Tensor<T> Exp10<T>(in ReadOnlyTensorSpan<T> x) 3741Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 3763public static Tensor<T> Exp10M1<T>(in ReadOnlyTensorSpan<T> x) 3766Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 3786public static Tensor<T> Exp2<T>(in ReadOnlyTensorSpan<T> x) 3789Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 3809public static Tensor<T> Exp2M1<T>(in ReadOnlyTensorSpan<T> x) 3812Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 3832public static Tensor<T> ExpM1<T>(in ReadOnlyTensorSpan<T> x) 3835Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 3855public static Tensor<T> Floor<T>(in ReadOnlyTensorSpan<T> x) 3858Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 3882public static Tensor<T> Hypot<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 3885TensorOperation.ValidateCompatibility(x, y, out Tensor<T> destination); 3911public static Tensor<T> Ieee754Remainder<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 3914TensorOperation.ValidateCompatibility(x, y, out Tensor<T> destination); 3935public static Tensor<T> Ieee754Remainder<T>(in ReadOnlyTensorSpan<T> x, T y) 3938Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 3958public static Tensor<T> Ieee754Remainder<T>(T x, in ReadOnlyTensorSpan<T> y) 3961Tensor<T> destination = CreateFromShapeUninitialized<T>(y.Lengths); 3982public static Tensor<int> ILogB<T>(in ReadOnlyTensorSpan<T> x) 3985Tensor<int> destination = CreateFromShapeUninitialized<int>(x.Lengths); 4050public static Tensor<T> LeadingZeroCount<T>(in ReadOnlyTensorSpan<T> x) 4053Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 4074/// Takes the natural logarithm of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 4077public static Tensor<T> Log<T>(in ReadOnlyTensorSpan<T> x) 4080Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 4101public static Tensor<T> Log<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 4104TensorOperation.ValidateCompatibility(x, y, out Tensor<T> destination); 4124public static Tensor<T> Log<T>(in ReadOnlyTensorSpan<T> x, T y) 4127Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 4147/// 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. 4150public static Tensor<T> Log10<T>(in ReadOnlyTensorSpan<T> x) 4153Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 4174/// 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. 4177public static Tensor<T> Log10P1<T>(in ReadOnlyTensorSpan<T> x) 4180Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 4201/// 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. 4204public static Tensor<T> Log2<T>(in ReadOnlyTensorSpan<T> x) 4207Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 4228/// 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. 4231public static Tensor<T> Log2P1<T>(in ReadOnlyTensorSpan<T> x) 4234Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 4255/// 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. 4258public static Tensor<T> LogP1<T>(in ReadOnlyTensorSpan<T> x) 4261Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 4299public static Tensor<T> Max<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 4302TensorOperation.ValidateCompatibility(in x, in y, out Tensor<T> output); 4322public static Tensor<T> Max<T>(in ReadOnlyTensorSpan<T> x, T y) 4325Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 4362public static Tensor<T> MaxMagnitude<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 4365TensorOperation.ValidateCompatibility(in x, in y, out Tensor<T> destination); 4385public static Tensor<T> MaxMagnitude<T>(in ReadOnlyTensorSpan<T> x, T y) 4388Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 4425public static Tensor<T> MaxMagnitudeNumber<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 4428TensorOperation.ValidateCompatibility(in x, in y, out Tensor<T> destination); 4448public static Tensor<T> MaxMagnitudeNumber<T>(in ReadOnlyTensorSpan<T> x, T y) 4451Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 4488public static Tensor<T> MaxNumber<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 4491TensorOperation.ValidateCompatibility(in x, in y, out Tensor<T> destination); 4511public static Tensor<T> MaxNumber<T>(in ReadOnlyTensorSpan<T> x, T y) 4514Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 4551public static Tensor<T> Min<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 4554TensorOperation.ValidateCompatibility(in x, in y, out Tensor<T> output); 4574public static Tensor<T> Min<T>(in ReadOnlyTensorSpan<T> x, T y) 4577Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 4614public static Tensor<T> MinMagnitude<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 4617TensorOperation.ValidateCompatibility(in x, in y, out Tensor<T> destination); 4637public static Tensor<T> MinMagnitude<T>(in ReadOnlyTensorSpan<T> x, T y) 4640Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 4677public static Tensor<T> MinMagnitudeNumber<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 4680TensorOperation.ValidateCompatibility(in x, in y, out Tensor<T> destination); 4700public static Tensor<T> MinMagnitudeNumber<T>(in ReadOnlyTensorSpan<T> x, T y) 4703Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 4740public static Tensor<T> MinNumber<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 4743TensorOperation.ValidateCompatibility(in x, in y, out Tensor<T> destination); 4763public static Tensor<T> MinNumber<T>(in ReadOnlyTensorSpan<T> x, T y) 4766Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 4801public static Tensor<T> PopCount<T>(in ReadOnlyTensorSpan<T> x) 4804Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 4825public static Tensor<T> Pow<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 4828TensorOperation.ValidateCompatibility(x, y, out Tensor<T> destination); 4848public static Tensor<T> Pow<T>(in ReadOnlyTensorSpan<T> x, T y) 4851Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 4871public static Tensor<T> Pow<T>(T x, in ReadOnlyTensorSpan<T> y) 4874Tensor<T> destination = CreateFromShapeUninitialized<T>(y.Lengths); 4907public static Tensor<T> RadiansToDegrees<T>(in ReadOnlyTensorSpan<T> x) 4910Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 4930public static Tensor<T> Reciprocal<T>(in ReadOnlyTensorSpan<T> x) 4933Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 4954public static Tensor<T> RootN<T>(in ReadOnlyTensorSpan<T> x, int n) 4957Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 4980public static Tensor<T> RotateLeft<T>(in ReadOnlyTensorSpan<T> x, int rotateAmount) 4983Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 5007public static Tensor<T> RotateRight<T>(in ReadOnlyTensorSpan<T> x, int rotateAmount) 5010Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 5032public static Tensor<T> Round<T>(in ReadOnlyTensorSpan<T> x) 5035Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 5055public static Tensor<T> Round<T>(in ReadOnlyTensorSpan<T> x, int digits, MidpointRounding mode) 5058Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 5079public static Tensor<T> Round<T>(in ReadOnlyTensorSpan<T> x, int digits) 5082Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 5102public static Tensor<T> Round<T>(in ReadOnlyTensorSpan<T> x, MidpointRounding mode) 5105Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 5126public static Tensor<T> Sigmoid<T>(in ReadOnlyTensorSpan<T> x) 5129Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 5148/// Takes the sin of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 5151public static Tensor<T> Sin<T>(in ReadOnlyTensorSpan<T> x) 5154Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 5176public static Tensor<T> Sinh<T>(in ReadOnlyTensorSpan<T> x) 5179Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 5199public static Tensor<T> SinPi<T>(in ReadOnlyTensorSpan<T> x) 5202Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 5222public static Tensor<T> SoftMax<T>(in ReadOnlyTensorSpan<T> x) 5228Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 5249/// Takes the square root of each element of the <see cref="ReadOnlyTensorSpan{T}"/> and returns a new <see cref="Tensor{T}"/> with the result. 5252public static Tensor<T> Sqrt<T>(in ReadOnlyTensorSpan<T> x) 5255Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 5324public static Tensor<T> Tan<T>(in ReadOnlyTensorSpan<T> x) 5327Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 5347public static Tensor<T> Tanh<T>(in ReadOnlyTensorSpan<T> x) 5350Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 5370public static Tensor<T> TanPi<T>(in ReadOnlyTensorSpan<T> x) 5373Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 5393public static Tensor<T> TrailingZeroCount<T>(in ReadOnlyTensorSpan<T> x) 5396Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 5416public static Tensor<T> Truncate<T>(in ReadOnlyTensorSpan<T> x) 5419Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths);
System\Numerics\Tensors\netcore\Tensor.op_Addition.cs (18)
14public static Tensor<T> Add<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 17TensorOperation.ValidateCompatibility(x, y, out Tensor<T> destination); 27public static Tensor<T> Add<T>(in ReadOnlyTensorSpan<T> x, T y) 30Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 74public static Tensor<TScalar> operator +(in ReadOnlyTensorSpan<TScalar> left, in ReadOnlyTensorSpan<TScalar> right) => Add(left, right); 80public static Tensor<TScalar> operator +(in ReadOnlyTensorSpan<TScalar> left, TScalar right) => Add(left, right); 86public static Tensor<TScalar> operator +(TScalar left, in ReadOnlyTensorSpan<TScalar> right) => Add(right, left); 90extension<TScalar>(Tensor<TScalar> tensor) 94public static Tensor<TScalar> operator +(Tensor<TScalar> left, Tensor<TScalar> right) => Add<TScalar>(left, right); 97public static Tensor<TScalar> operator +(Tensor<TScalar> left, TScalar right) => Add(left, right); 100public static Tensor<TScalar> operator +(TScalar left, Tensor<TScalar> right) => Add(right, left); 115public static Tensor<TScalar> operator +(in TensorSpan<TScalar> left, in TensorSpan<TScalar> right) => Add<TScalar>(left, right); 118public static Tensor<TScalar> operator +(in TensorSpan<TScalar> left, TScalar right) => Add(left, right); 121public static Tensor<TScalar> operator +(TScalar left, in TensorSpan<TScalar> right) => Add(right, left);
System\Numerics\Tensors\netcore\Tensor.op_BitwiseAnd.cs (18)
14public static Tensor<T> BitwiseAnd<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 17TensorOperation.ValidateCompatibility(x, y, out Tensor<T> destination); 27public static Tensor<T> BitwiseAnd<T>(in ReadOnlyTensorSpan<T> x, T y) 30Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 74public static Tensor<TScalar> operator &(in ReadOnlyTensorSpan<TScalar> left, in ReadOnlyTensorSpan<TScalar> right) => BitwiseAnd(left, right); 80public static Tensor<TScalar> operator &(in ReadOnlyTensorSpan<TScalar> left, TScalar right) => BitwiseAnd(left, right); 86public static Tensor<TScalar> operator &(TScalar left, in ReadOnlyTensorSpan<TScalar> right) => BitwiseAnd(right, left); 90extension<TScalar>(Tensor<TScalar> tensor) 94public static Tensor<TScalar> operator &(Tensor<TScalar> left, Tensor<TScalar> right) => BitwiseAnd<TScalar>(left, right); 97public static Tensor<TScalar> operator &(Tensor<TScalar> left, TScalar right) => BitwiseAnd(left, right); 100public static Tensor<TScalar> operator &(TScalar left, Tensor<TScalar> right) => BitwiseAnd(right, left); 115public static Tensor<TScalar> operator &(in TensorSpan<TScalar> left, in TensorSpan<TScalar> right) => BitwiseAnd<TScalar>(left, right); 118public static Tensor<TScalar> operator &(in TensorSpan<TScalar> left, TScalar right) => BitwiseAnd(left, right); 121public static Tensor<TScalar> operator &(TScalar left, in TensorSpan<TScalar> right) => BitwiseAnd(right, left);
System\Numerics\Tensors\netcore\Tensor.op_BitwiseOr.cs (18)
14public static Tensor<T> BitwiseOr<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 17TensorOperation.ValidateCompatibility(x, y, out Tensor<T> destination); 27public static Tensor<T> BitwiseOr<T>(in ReadOnlyTensorSpan<T> x, T y) 30Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 74public static Tensor<TScalar> operator |(in ReadOnlyTensorSpan<TScalar> left, in ReadOnlyTensorSpan<TScalar> right) => BitwiseOr(left, right); 80public static Tensor<TScalar> operator |(in ReadOnlyTensorSpan<TScalar> left, TScalar right) => BitwiseOr(left, right); 86public static Tensor<TScalar> operator |(TScalar left, in ReadOnlyTensorSpan<TScalar> right) => BitwiseOr(right, left); 90extension<TScalar>(Tensor<TScalar> tensor) 94public static Tensor<TScalar> operator |(Tensor<TScalar> left, Tensor<TScalar> right) => BitwiseOr<TScalar>(left, right); 97public static Tensor<TScalar> operator |(Tensor<TScalar> left, TScalar right) => BitwiseOr(left, right); 100public static Tensor<TScalar> operator |(TScalar left, Tensor<TScalar> right) => BitwiseOr(right, left); 115public static Tensor<TScalar> operator |(in TensorSpan<TScalar> left, in TensorSpan<TScalar> right) => BitwiseOr<TScalar>(left, right); 118public static Tensor<TScalar> operator |(in TensorSpan<TScalar> left, TScalar right) => BitwiseOr(left, right); 121public static Tensor<TScalar> operator |(TScalar left, in TensorSpan<TScalar> right) => BitwiseOr(right, left);
System\Numerics\Tensors\netcore\Tensor.op_Decrement.cs (3)
12public static Tensor<T> Decrement<T>(in ReadOnlyTensorSpan<T> x) 15Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 36extension<TScalar>(Tensor<TScalar> tensor)
System\Numerics\Tensors\netcore\Tensor.op_Division.cs (20)
14public static Tensor<T> Divide<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 17TensorOperation.ValidateCompatibility(x, y, out Tensor<T> destination); 27public static Tensor<T> Divide<T>(in ReadOnlyTensorSpan<T> x, T y) 30Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 40public static Tensor<T> Divide<T>(T x, in ReadOnlyTensorSpan<T> y) 43Tensor<T> destination = CreateFromShapeUninitialized<T>(y.Lengths); 101public static Tensor<TScalar> operator /(in ReadOnlyTensorSpan<TScalar> left, in ReadOnlyTensorSpan<TScalar> right) => Divide(left, right); 107public static Tensor<TScalar> operator /(in ReadOnlyTensorSpan<TScalar> left, TScalar right) => Divide(left, right); 113public static Tensor<TScalar> operator /(TScalar left, in ReadOnlyTensorSpan<TScalar> right) => Divide(left, right); 117extension<TScalar>(Tensor<TScalar> tensor) 121public static Tensor<TScalar> operator /(Tensor<TScalar> left, Tensor<TScalar> right) => Divide<TScalar>(left, right); 124public static Tensor<TScalar> operator /(Tensor<TScalar> left, TScalar right) => Divide(left, right); 127public static Tensor<TScalar> operator /(TScalar left, Tensor<TScalar> right) => Divide(left, right); 142public static Tensor<TScalar> operator /(in TensorSpan<TScalar> left, in TensorSpan<TScalar> right) => Divide<TScalar>(left, right); 145public static Tensor<TScalar> operator /(in TensorSpan<TScalar> left, TScalar right) => Divide(left, right); 148public static Tensor<TScalar> operator /(TScalar left, in TensorSpan<TScalar> right) => Divide(left, right);
System\Numerics\Tensors\netcore\Tensor.op_ExclusiveOr.cs (18)
14public static Tensor<T> Xor<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 17TensorOperation.ValidateCompatibility(x, y, out Tensor<T> destination); 27public static Tensor<T> Xor<T>(in ReadOnlyTensorSpan<T> x, T y) 30Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 74public static Tensor<TScalar> operator ^(in ReadOnlyTensorSpan<TScalar> left, in ReadOnlyTensorSpan<TScalar> right) => Xor(left, right); 80public static Tensor<TScalar> operator ^(in ReadOnlyTensorSpan<TScalar> left, TScalar right) => Xor(left, right); 86public static Tensor<TScalar> operator ^(TScalar left, in ReadOnlyTensorSpan<TScalar> right) => Xor(right, left); 90extension<TScalar>(Tensor<TScalar> tensor) 94public static Tensor<TScalar> operator ^(Tensor<TScalar> left, Tensor<TScalar> right) => Xor<TScalar>(left, right); 97public static Tensor<TScalar> operator ^(Tensor<TScalar> left, TScalar right) => Xor(left, right); 100public static Tensor<TScalar> operator ^(TScalar left, Tensor<TScalar> right) => Xor(right, left); 115public static Tensor<TScalar> operator ^(in TensorSpan<TScalar> left, in TensorSpan<TScalar> right) => Xor<TScalar>(left, right); 118public static Tensor<TScalar> operator ^(in TensorSpan<TScalar> left, TScalar right) => Xor(left, right); 121public static Tensor<TScalar> operator ^(TScalar left, in TensorSpan<TScalar> right) => Xor(right, left);
System\Numerics\Tensors\netcore\Tensor.op_Increment.cs (3)
12public static Tensor<T> Increment<T>(in ReadOnlyTensorSpan<T> x) 15Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 36extension<TScalar>(Tensor<TScalar> tensor)
System\Numerics\Tensors\netcore\Tensor.op_LeftShift.cs (8)
13public static Tensor<T> ShiftLeft<T>(in ReadOnlyTensorSpan<T> x, int shiftAmount) 16Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 44public static Tensor<TScalar> operator <<(in ReadOnlyTensorSpan<TScalar> tensor, int shiftAmount) => ShiftLeft(tensor, shiftAmount); 48extension<TScalar>(Tensor<TScalar>) 52public static Tensor<TScalar> operator <<(Tensor<TScalar> tensor, int shiftAmount) => ShiftLeft<TScalar>(tensor, shiftAmount); 57extension<TScalar>(Tensor<TScalar> tensor) 69public static Tensor<TScalar> operator <<(in TensorSpan<TScalar> tensor, int shiftAmount) => ShiftLeft<TScalar>(tensor, shiftAmount);
System\Numerics\Tensors\netcore\Tensor.op_Multiply.cs (18)
14public static Tensor<T> Multiply<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 17TensorOperation.ValidateCompatibility(x, y, out Tensor<T> destination); 27public static Tensor<T> Multiply<T>(in ReadOnlyTensorSpan<T> x, T y) 30Tensor<T> destination = CreateFromShape<T>(x.Lengths); 74public static Tensor<TScalar> operator *(in ReadOnlyTensorSpan<TScalar> left, in ReadOnlyTensorSpan<TScalar> right) => Multiply(left, right); 80public static Tensor<TScalar> operator *(in ReadOnlyTensorSpan<TScalar> left, TScalar right) => Multiply(left, right); 86public static Tensor<TScalar> operator *(TScalar left, in ReadOnlyTensorSpan<TScalar> right) => Multiply(right, left); 90extension<TScalar>(Tensor<TScalar> tensor) 94public static Tensor<TScalar> operator *(Tensor<TScalar> left, Tensor<TScalar> right) => Multiply<TScalar>(left, right); 97public static Tensor<TScalar> operator *(Tensor<TScalar> left, TScalar right) => Multiply(left, right); 100public static Tensor<TScalar> operator *(TScalar left, Tensor<TScalar> right) => Multiply(right, left); 115public static Tensor<TScalar> operator *(in TensorSpan<TScalar> left, in TensorSpan<TScalar> right) => Multiply<TScalar>(left, right); 118public static Tensor<TScalar> operator *(in TensorSpan<TScalar> left, TScalar right) => Multiply(left, right); 121public static Tensor<TScalar> operator *(TScalar left, in TensorSpan<TScalar> right) => Multiply(right, left);
System\Numerics\Tensors\netcore\Tensor.op_OnesComplement.cs (7)
12public static Tensor<T> OnesComplement<T>(in ReadOnlyTensorSpan<T> x) 15Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 41public static Tensor<TScalar> operator ~(in ReadOnlyTensorSpan<TScalar> tensor) => OnesComplement(tensor); 45extension<TScalar>(Tensor<TScalar>) 49public static Tensor<TScalar> operator ~(Tensor<TScalar> tensor) => OnesComplement<TScalar>(tensor); 57public static Tensor<TScalar> operator ~(in TensorSpan<TScalar> tensor) => OnesComplement<TScalar>(tensor);
System\Numerics\Tensors\netcore\Tensor.op_RightShift.cs (8)
13public static Tensor<T> ShiftRightArithmetic<T>(in ReadOnlyTensorSpan<T> x, int shiftAmount) 16Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 44public static Tensor<TScalar> operator >>(in ReadOnlyTensorSpan<TScalar> tensor, int shiftAmount) => ShiftRightArithmetic(tensor, shiftAmount); 48extension<TScalar>(Tensor<TScalar>) 52public static Tensor<TScalar> operator >>(Tensor<TScalar> tensor, int shiftAmount) => ShiftRightArithmetic<TScalar>(tensor, shiftAmount); 57extension<TScalar>(Tensor<TScalar> tensor) 69public static Tensor<TScalar> operator >>(in TensorSpan<TScalar> tensor, int shiftAmount) => ShiftRightArithmetic<TScalar>(tensor, shiftAmount);
System\Numerics\Tensors\netcore\Tensor.op_Subtraction.cs (20)
14public static Tensor<T> Subtract<T>(in ReadOnlyTensorSpan<T> x, in ReadOnlyTensorSpan<T> y) 17TensorOperation.ValidateCompatibility(x, y, out Tensor<T> destination); 27public static Tensor<T> Subtract<T>(in ReadOnlyTensorSpan<T> x, T y) 30Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 40public static Tensor<T> Subtract<T>(T x, in ReadOnlyTensorSpan<T> y) 43Tensor<T> destination = CreateFromShapeUninitialized<T>(y.Lengths); 102public static Tensor<TScalar> operator -(in ReadOnlyTensorSpan<TScalar> left, in ReadOnlyTensorSpan<TScalar> right) => Subtract(left, right); 108public static Tensor<TScalar> operator -(in ReadOnlyTensorSpan<TScalar> left, TScalar right) => Subtract(left, right); 114public static Tensor<TScalar> operator -(TScalar left, in ReadOnlyTensorSpan<TScalar> right) => Subtract(left, right); 118extension<TScalar>(Tensor<TScalar> tensor) 122public static Tensor<TScalar> operator -(Tensor<TScalar> left, Tensor<TScalar> right) => Subtract<TScalar>(left, right); 125public static Tensor<TScalar> operator -(Tensor<TScalar> left, TScalar right) => Subtract(left, right); 128public static Tensor<TScalar> operator -(TScalar left, Tensor<TScalar> right) => Subtract(left, right); 143public static Tensor<TScalar> operator -(in TensorSpan<TScalar> left, in TensorSpan<TScalar> right) => Subtract<TScalar>(left, right); 146public static Tensor<TScalar> operator -(in TensorSpan<TScalar> left, TScalar right) => Subtract(left, right); 149public static Tensor<TScalar> operator -(TScalar left, in TensorSpan<TScalar> right) => Subtract(left, right);
System\Numerics\Tensors\netcore\Tensor.op_UnaryNegation.cs (7)
11public static Tensor<T> Negate<T>(in ReadOnlyTensorSpan<T> x) 14Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 39public static Tensor<TScalar> operator -(in ReadOnlyTensorSpan<TScalar> tensor) => Negate(tensor); 43extension<TScalar>(Tensor<TScalar>) 47public static Tensor<TScalar> operator -(Tensor<TScalar> tensor) => Negate<TScalar>(tensor); 55public static Tensor<TScalar> operator -(in TensorSpan<TScalar> tensor) => Negate<TScalar>(tensor);
System\Numerics\Tensors\netcore\Tensor.op_UnaryPlus.cs (3)
19extension<TScalar>(Tensor<TScalar>) 23public static Tensor<TScalar> operator +(Tensor<TScalar> tensor) => tensor;
System\Numerics\Tensors\netcore\Tensor.op_UnsignedRightShift.cs (8)
13public static Tensor<T> ShiftRightLogical<T>(in ReadOnlyTensorSpan<T> x, int shiftAmount) 16Tensor<T> destination = CreateFromShapeUninitialized<T>(x.Lengths); 44public static Tensor<TScalar> operator >>>(in ReadOnlyTensorSpan<TScalar> tensor, int shiftAmount) => ShiftRightLogical(tensor, shiftAmount); 48extension<TScalar>(Tensor<TScalar>) 52public static Tensor<TScalar> operator >>>(Tensor<TScalar> tensor, int shiftAmount) => ShiftRightLogical<TScalar>(tensor, shiftAmount); 57extension<TScalar>(Tensor<TScalar> tensor) 69public static Tensor<TScalar> operator >>>(in TensorSpan<TScalar> tensor, int shiftAmount) => ShiftRightLogical<TScalar>(tensor, shiftAmount);
System\Numerics\Tensors\netcore\TensorOperation.cs (1)
868public static void ValidateCompatibility<TArg, TResult>(in ReadOnlyTensorSpan<TArg> x, in ReadOnlyTensorSpan<TArg> y, out Tensor<TResult> destination)
System\Runtime\InteropServices\TensorMarshal.cs (1)
9/// <summary>Provides methods to interoperate with <see cref="Tensor{T}" />, <see cref="TensorSpan{T}" />, and <see cref="ReadOnlyTensorSpan{T}" />.</summary>