TensorPrimitives.Log2 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
| Log2(ReadOnlySpan<Single>, Span<Single>) |
計算指定張量中單精度浮點數的元素基底 2 對數。 |
| Log2<T>(ReadOnlySpan<T>, Span<T>) |
計算指定張量中以元素為底數的 2 對數。 |
Log2(ReadOnlySpan<Single>, Span<Single>)
計算指定張量中單精度浮點數的元素基底 2 對數。
public:
static void Log2(ReadOnlySpan<float> x, Span<float> destination);
public static void Log2(ReadOnlySpan<float> x, Span<float> destination);
static member Log2 : ReadOnlySpan<single> * Span<single> -> unit
Public Shared Sub Log2 (x As ReadOnlySpan(Of Single), destination As Span(Of Single))
參數
以範圍表示的張量。
例外狀況
x 和 destination 參考重疊的記憶體位置,而且不會從相同的位置開始。
備註
這個方法會有效地計算 。destination[i] = MathF.Log2(x[i])
如果值等於 0,則儲存至對應目的地位置的結果會設定為 NegativeInfinity。 如果值為負數或等於 NaN,則儲存至對應目的地位置的結果會設定為 NaN。 如果值為正無限大,則儲存至對應目的地位置的結果會設定為 PositiveInfinity。 否則,如果值為正數,其自然對數會儲存到對應的目的地位置。
這個方法可能會呼叫基礎 C 運行時間,或採用目前架構特有的指示。 不同操作系統或架構之間的確切結果可能會有所不同。
適用於
Log2<T>(ReadOnlySpan<T>, Span<T>)
計算指定張量中以元素為底數的 2 對數。
public:
generic <typename T>
where T : System::Numerics::ILogarithmicFunctions<T> static void Log2(ReadOnlySpan<T> x, Span<T> destination);
public static void Log2<T>(ReadOnlySpan<T> x, Span<T> destination) where T : System.Numerics.ILogarithmicFunctions<T>;
static member Log2 : ReadOnlySpan<'T (requires 'T :> System.Numerics.ILogarithmicFunctions<'T>)> * Span<'T (requires 'T :> System.Numerics.ILogarithmicFunctions<'T>)> -> unit (requires 'T :> System.Numerics.ILogarithmicFunctions<'T>)
Public Shared Sub Log2(Of T As ILogarithmicFunctions(Of T)) (x As ReadOnlySpan(Of T), destination As Span(Of T))
類型參數
- T
參數
以範圍表示的張量。
- destination
- Span<T>
目的地張量,以範圍表示。
例外狀況
x 和 destination 參考重疊的記憶體位置,而且不會從相同的位置開始。
備註
這個方法會有效地計算 。destination[i] = T.Log2(x[i])
如果值等於 0,則儲存至對應目的地位置的結果會設定為 NegativeInfinity。 如果值為負數或等於 NaN,則儲存至對應目的地位置的結果會設定為 NaN。 如果值為正無限大,則儲存至對應目的地位置的結果會設定為 PositiveInfinity。 否則,如果值為正數,其基底 2 對數會儲存至對應的目的地位置。
這個方法可能會呼叫基礎 C 運行時間,或採用目前架構特有的指示。 不同操作系統或架構之間的確切結果可能會有所不同。