flux2_feed_forward

FLUX.2 feed-forward (fused SwiGLU)

Description

linear_in projects to twice the inner dim; SwiGLU gates the first half with SiLU and multiplies by the second half; linear_out projects back. Reference: Flux2FeedForward + Flux2SwiGLU.

Usage

flux2_feed_forward(dim, dim_out = NULL, mult = 3, bias = FALSE)

Arguments

  • dim: Integer. Input dimension.
  • dim_out: Integer. Output dimension (defaults to dim).
  • mult: Numeric. Inner dim multiplier (FLUX.2: 3.0).
  • bias: Logical.