TensorPrimitives.Reciprocal<T> 方法

定义

计算指定张量中的数字的元素倒数。

public:
generic <typename T>
 where T : System::Numerics::IFloatingPoint<T> static void Reciprocal(ReadOnlySpan<T> x, Span<T> destination);
public static void Reciprocal<T> (ReadOnlySpan<T> x, Span<T> destination) where T : System.Numerics.IFloatingPoint<T>;
static member Reciprocal : ReadOnlySpan<'T (requires 'T :> System.Numerics.IFloatingPoint<'T>)> * Span<'T (requires 'T :> System.Numerics.IFloatingPoint<'T>)> -> unit (requires 'T :> System.Numerics.IFloatingPoint<'T>)
Public Shared Sub Reciprocal(Of T As IFloatingPoint(Of T)) (x As ReadOnlySpan(Of T), destination As Span(Of T))

类型参数

T

参数

x
ReadOnlySpan<T>

张量,表示为范围。

destination
Span<T>

目标张量,表示为范围。

例外

xdestination 引用重叠的内存位置,并且不在同一位置开始。

T 是整数类型,x 中的元素等于零。

注解

此方法有效地计算 destination[i] = 1 / x[i]

适用于