Shortcuts

Class Sequential

Inheritance Relationships

Base Type

Class Documentation

class Sequential : public torch::nn::ModuleHolder<SequentialImpl>

A ModuleHolder subclass for SequentialImpl.

See the documentation for SequentialImpl class to learn what methods it provides, or the documentation for ModuleHolder to learn about PyTorch’s module storage semantics.

Public Functions

inline Sequential()
inline Sequential(std::initializer_list<NamedAnyModule> named_modules)

Constructs the Sequential from a braced-init-list of named AnyModules.

It enables the following use case: Sequential sequential({{"m1", M(1)}, {"m2", M(2)}})

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources