(rontolisp) docs
← Functions

torch:sequential

(torch:sequential &rest layers)

Returns a chain of layers (PyTorch's nn.Sequential): the forward threads its argument through each element in order. An element may be a module or a plain function, so an activation goes in as (function torch:relu) -- there is no separate activation-module type. The elements live in the single field :layers, and torch:parameters walks that list, so every nested parameter is reachable.

A list of modules is itself a valid field value everywhere in this package, so a stack of N identical blocks needs no ModuleList type: hold the list in a field of your own torch:module and the walk finds it.