TensorPrimitives.Round 方法

定义

重载

Round<T>(ReadOnlySpan<T>, Span<T>)

计算指定张量中数字的元素舍入

Round<T>(ReadOnlySpan<T>, Int32, Span<T>)

计算指定张量中数字的元素舍入

Round<T>(ReadOnlySpan<T>, MidpointRounding, Span<T>)

计算指定张量中数字的元素舍入

Round<T>(ReadOnlySpan<T>, Int32, MidpointRounding, Span<T>)

计算指定张量中数字的元素舍入

Round<T>(ReadOnlySpan<T>, Span<T>)

Source:
TensorPrimitives.Round.cs
Source:
TensorPrimitives.Round.cs

计算指定张量中数字的元素舍入

public:
generic <typename T>
 where T : System::Numerics::IFloatingPoint<T> static void Round(ReadOnlySpan<T> x, Span<T> destination);
public static void Round<T> (ReadOnlySpan<T> x, Span<T> destination) where T : System.Numerics.IFloatingPoint<T>;
static member Round : 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 Round(Of T As IFloatingPoint(Of T)) (x As ReadOnlySpan(Of T), destination As Span(Of T))

类型参数

T

参数

x
ReadOnlySpan<T>

张量,表示为范围。

destination
Span<T>

目标张量,表示为范围。

例外

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

注解

此方法有效地计算 destination[i] = T.Round(x[i])

适用于

Round<T>(ReadOnlySpan<T>, Int32, Span<T>)

Source:
TensorPrimitives.Round.cs
Source:
TensorPrimitives.Round.cs

计算指定张量中数字的元素舍入

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

类型参数

T

参数

x
ReadOnlySpan<T>

张量,表示为范围。

digits
Int32

应舍入 x 中的数字的小数位数。

destination
Span<T>

目标张量,表示为范围。

例外

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

注解

此方法有效地计算 destination[i] = T.Round(x[i], digits)

适用于

Round<T>(ReadOnlySpan<T>, MidpointRounding, Span<T>)

Source:
TensorPrimitives.Round.cs
Source:
TensorPrimitives.Round.cs

计算指定张量中数字的元素舍入

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

类型参数

T

参数

x
ReadOnlySpan<T>

张量,表示为范围。

mode
MidpointRounding

应在其中舍入 x 的模式。

destination
Span<T>

目标张量,表示为范围。

例外

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

注解

此方法有效地计算 destination[i] = T.Round(x[i], mode)

适用于

Round<T>(ReadOnlySpan<T>, Int32, MidpointRounding, Span<T>)

Source:
TensorPrimitives.Round.cs
Source:
TensorPrimitives.Round.cs

计算指定张量中数字的元素舍入

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

类型参数

T

参数

x
ReadOnlySpan<T>

张量,表示为范围。

digits
Int32

应舍入 x 中的数字的小数位数。

mode
MidpointRounding

应在其中舍入 x 的模式。

destination
Span<T>

目标张量,表示为范围。

例外

mode 无效。

digits 无效。

注解

此方法有效地计算 destination[i] = T.Round(x[i], digits, mode)

适用于