A neural network is usually pictured as a stack, but the thing actually being composed is a wiring of blocks, outputs plugged into inputs, in parallel and in series. That composition law is not a category’s but an operad’s, with many inputs feeding one output, glued like discs inside a disc.
Each block is an operation with a list of typed input ports and one output port. Composing blocks is substitution, feeding the outputs of several blocks into the input slots of another, and this is exactly the multi-input, single-output composition of an operad. Because ports carry types such as tensor shapes and modalities, the right object is a coloured operad, equivalently a multicategory. The colours are the port types, and an operation
Most blocks break the single-output restriction, since attention, residual splits, and multi-head fan-out all have several outputs. A block with
Remark on wiring versus stacking
Sequential depth is only the unary fragment of this structure. What the operad/properad adds is the bookkeeping of parallel composition and of typed ports, so that a wiring diagram is a well-formed term rather than a picture. This places block composition beside string diagrams. The diagram is the syntax, the (pr)operad is the algebra it denotes, and a trained network is one algebra of that theory.
Remark on equivariance and sharing, deferred
A bare operad has no way to duplicate or discard a wire, yet weight-tying and skip connections need that. Supplying each colour with a comonoid (copy/delete) upgrades the properad toward a hypergraph-category discipline, a move worth flagging but not made here.