マージ可能

public protocol Mergeable : AdditiveArithmetic, Differentiable

微分可能な二項演算をサポートする値を持つ型。

マージ関数の一般的な要件としてBidirectionalRecurrentLayerによって使用されます。

  • 2 つの値を連結します。

    宣言

    @differentiable
    static func concatenate(_ lhs: Self, _ rhs: Self) -> Self
  • 2 つの値を加算し、その合計を計算します。

    注記

    sumの名前を+に変更すると、 TensorMergeableに適合させるときにコンパイラがクラッシュします (SR-13229)。

    宣言

    @differentiable
    static func sum(_ lhs: Self, _ rhs: Self) -> Self
  • 2 つの値を平均します。

    宣言

    @differentiable
    static func average(_ lhs: Self, _ rhs: Self) -> Self
  • 2 つの値を乗算します。

    宣言

    @differentiable
    static func multiply(_ lhs: Self, _ rhs: Self) -> Self
  • 2 つの値をスタックします。

    宣言

    @differentiable
    static func stack(_ lhs: Self, _ rhs: Self) -> Self