Skip to main content

c2psa

Function c2psa 

Source
pub fn c2psa<D: Float + Send + Sync + 'static>(
    c_in: usize,
    c_out: usize,
    n: usize,
    e: f32,
) -> impl Fn(SymTensor) -> SymTensor
Expand description

C2PSA: cross-stage partial network with PSA attention blocks.

Matches ultralytics.nn.modules.block.C2PSA(c1, c2, n, e).

Forward: h = cv1(x) // [B, 2*c, H, W] [a, b] = split(h, c) // each [B, c, H, W] b = PSABlock(b) × n output = cv2(cat(a, b)) // [B, c2, H, W]