TensorPrimitives.ProductOfSums 方法

定义

重载

ProductOfSums(ReadOnlySpan<Single>, ReadOnlySpan<Single>)

计算指定非空张量中单精度浮点数的按元素求和的乘积。

ProductOfSums<T>(ReadOnlySpan<T>, ReadOnlySpan<T>)

计算指定非空张量中数字的按元素计算的总和。

ProductOfSums(ReadOnlySpan<Single>, ReadOnlySpan<Single>)

Source:
TensorPrimitives.cs
Source:
TensorPrimitives.Single.cs

计算指定非空张量中单精度浮点数的按元素求和的乘积。

public:
 static float ProductOfSums(ReadOnlySpan<float> x, ReadOnlySpan<float> y);
public static float ProductOfSums (ReadOnlySpan<float> x, ReadOnlySpan<float> y);
static member ProductOfSums : ReadOnlySpan<single> * ReadOnlySpan<single> -> single
Public Shared Function ProductOfSums (x As ReadOnlySpan(Of Single), y As ReadOnlySpan(Of Single)) As Single

参数

x
ReadOnlySpan<Single>

第一个张量,表示为范围。

y
ReadOnlySpan<Single>

第二个张量,表示为范围。

返回

将每个张量中元素的按元素相加的结果。

例外

xy 的长度必须相同。

注解

此方法有效计算: Span<float> sums = ...; TensorPrimitives.Add(x, y, sums); float result = TensorPrimitives.Product(sums); ,但不需要为中间总和提供额外的临时存储。

此方法可以调用基础 C 运行时,或使用特定于当前体系结构的说明。 不同的操作系统或体系结构之间的确切结果可能有所不同。

适用于

ProductOfSums<T>(ReadOnlySpan<T>, ReadOnlySpan<T>)

Source:
TensorPrimitives.Product.cs

计算指定非空张量中数字的按元素计算的总和。

public:
generic <typename T>
 where T : System::Numerics::IAdditionOperators<T, T, T>, System::Numerics::IAdditiveIdentity<T, T>, System::Numerics::IMultiplyOperators<T, T, T>, System::Numerics::IMultiplicativeIdentity<T, T> static T ProductOfSums(ReadOnlySpan<T> x, ReadOnlySpan<T> y);
public static T ProductOfSums<T> (ReadOnlySpan<T> x, ReadOnlySpan<T> y) where T : System.Numerics.IAdditionOperators<T,T,T>, System.Numerics.IAdditiveIdentity<T,T>, System.Numerics.IMultiplyOperators<T,T,T>, System.Numerics.IMultiplicativeIdentity<T,T>;
static member ProductOfSums : ReadOnlySpan<'T (requires 'T :> System.Numerics.IAdditionOperators<'T, 'T, 'T> and 'T :> System.Numerics.IAdditiveIdentity<'T, 'T> and 'T :> System.Numerics.IMultiplyOperators<'T, 'T, 'T> and 'T :> System.Numerics.IMultiplicativeIdentity<'T, 'T>)> * ReadOnlySpan<'T (requires 'T :> System.Numerics.IAdditionOperators<'T, 'T, 'T> and 'T :> System.Numerics.IAdditiveIdentity<'T, 'T> and 'T :> System.Numerics.IMultiplyOperators<'T, 'T, 'T> and 'T :> System.Numerics.IMultiplicativeIdentity<'T, 'T>)> -> 'T (requires 'T :> System.Numerics.IAdditionOperators<'T, 'T, 'T> and 'T :> System.Numerics.IAdditiveIdentity<'T, 'T> and 'T :> System.Numerics.IMultiplyOperators<'T, 'T, 'T> and 'T :> System.Numerics.IMultiplicativeIdentity<'T, 'T>)
Public Shared Function ProductOfSums(Of T As {IAdditionOperators(Of T, T, T), IAdditiveIdentity(Of T, T), IMultiplyOperators(Of T, T, T), IMultiplicativeIdentity(Of T, T)}) (x As ReadOnlySpan(Of T), y As ReadOnlySpan(Of T)) As T

类型参数

T

参数

x
ReadOnlySpan<T>

第一个张量,表示为范围。

y
ReadOnlySpan<T>

第二个张量,表示为范围。

返回

T

将每个张量中元素的按元素相加的结果。

例外

xy 的长度必须相同。

注解

此方法有效计算: Span<T> sums = ...; TensorPrimitives.Add(x, y, sums); T result = TensorPrimitives.Product(sums); ,但不需要为中间总和提供额外的临时存储。

此方法可以调用基础 C 运行时,或使用特定于当前体系结构的说明。 不同的操作系统或体系结构之间的确切结果可能有所不同。

适用于