TensorPrimitives.Norm 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
| Norm(ReadOnlySpan<Single>) |
计算单精度浮点数的指定张量的 Euclidean 规范。 |
| Norm<T>(ReadOnlySpan<T>) |
计算指定数值张量的 Euclidean 规范。 |
Norm(ReadOnlySpan<Single>)
- Source:
- TensorPrimitives.cs
- Source:
- TensorPrimitives.Single.cs
- Source:
- TensorPrimitives.Single.cs
计算单精度浮点数的指定张量的 Euclidean 规范。
public:
static float Norm(ReadOnlySpan<float> x);
public static float Norm(ReadOnlySpan<float> x);
static member Norm : ReadOnlySpan<single> -> single
Public Shared Function Norm (x As ReadOnlySpan(Of Single)) As Single
参数
第一个张量,表示为范围。
返回
规范。
注解
此方法有效地计算 MathF.Sqrt(TensorPrimitives.SumOfSquares(x))。 这通常称为 Euclidean 规范或 L2 规范。 它对应于 BLAS1定义的 nrm2 方法。
如果任一输入值等于 NaN,则结果值也为 NaN。
此方法可以调用基础 C 运行时,或使用特定于当前体系结构的说明。 不同的操作系统或体系结构之间的确切结果可能有所不同。
适用于
Norm<T>(ReadOnlySpan<T>)
- Source:
- TensorPrimitives.Norm.cs
- Source:
- TensorPrimitives.Norm.cs
计算指定数值张量的 Euclidean 规范。
public:
generic <typename T>
where T : System::Numerics::IRootFunctions<T> static T Norm(ReadOnlySpan<T> x);
public static T Norm<T>(ReadOnlySpan<T> x) where T : System.Numerics.IRootFunctions<T>;
static member Norm : ReadOnlySpan<'T (requires 'T :> System.Numerics.IRootFunctions<'T>)> -> 'T (requires 'T :> System.Numerics.IRootFunctions<'T>)
Public Shared Function Norm(Of T As IRootFunctions(Of T)) (x As ReadOnlySpan(Of T)) As T
类型参数
- T
参数
第一个张量,表示为范围。
返回
规范。
注解
此方法有效地计算 。 这通常称为 Euclidean 规范或 L2 规范。 它对应于 T.Sqrt(TensorPrimitives.SumOfSquares(x))BLAS1定义的 nrm2 方法。
如果任一输入值等于 NaN,则结果值也为 NaN。
此方法可以调用基础 C 运行时,或使用特定于当前体系结构的说明。 不同的操作系统或体系结构之间的确切结果可能有所不同。