TensorPrimitives.ShiftLeft<T> 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
根據指定的移位量,計算指定之張量中數字的元素向左移位。
public:
generic <typename T>
where T : System::Numerics::IShiftOperators<T, int, T> static void ShiftLeft(ReadOnlySpan<T> x, int shiftAmount, Span<T> destination);
public static void ShiftLeft<T>(ReadOnlySpan<T> x, int shiftAmount, Span<T> destination) where T : System.Numerics.IShiftOperators<T,int,T>;
static member ShiftLeft : 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 ShiftLeft(Of T As IShiftOperators(Of T, Integer, T)) (x As ReadOnlySpan(Of T), shiftAmount As Integer, destination As Span(Of T))
類型參數
- T
參數
以範圍表示的張量。
- shiftAmount
- Int32
要移位的位數,以純量表示。
- destination
- Span<T>
目的地張量,以範圍表示。
例外狀況
x 和 destination 參考重疊的記憶體位置,而且不會從相同的位置開始。
備註
這個方法會有效地計算 。destination[i] = x[i] << shiftAmount