core/nn/lc0 library
LC0 classical CNN (with optional SE units) — GPU inference.
Assembles the network described by an Lc0Weights value into a forward pass. BN is folded into the preceding conv's weights and biases at construction time, exactly matching lc0/src/neural/network_legacy.cc:
new_gammao = gammao / sqrt(varo + 1e-5)
new_weighto, ... = weighto, ... * new_gammao
new_biaso = -new_gammao * (meano - old_biaso) + betao
Runtime layout: NHWC-flat [H*W, C] throughout the tower. This
shape lets bias-add, skip-add, and SE's per-channel gate use the
existing GPU row-broadcast ([H*W, C] + [1, C]), and it means
Conv2d's matmul output can flow straight into the next layer
without a host-side NCHW permute.
Reference: lc0/src/neural/backends/blas/{network_blas.cc, se_unit.cc}.