TensorPrimitives.ShiftRightArithmetic<T> 方法

定义

计算按指定移位量在指定张量中数字右移的元素算术(signed)。

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

类型参数

T

参数

x
ReadOnlySpan<T>

张量,表示为范围。

shiftAmount
Int32

要移动的位数,表示为标量。

destination
Span<T>

目标张量,表示为范围。

例外

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

注解

此方法有效地计算 destination[i] = x[i] >> shiftAmount

适用于