---
title: "Sequential"
sidebar_label: "Sequential"
description: "The clika_runtime.nn Sequential class."
---

<!-- Generated by tools/api_reference/generate_api_docs.py. Do not edit. -->

Sequential(*modules) / Sequential(ordered_dict)

    Run the given modules in order: ``Sequential(a, b)(x) == b(a(x))``.
    Modules register under their position (``"0"``, ``"1"``, ...), or
    under the given keys when constructed from an ordered mapping. It is
    indexable (``net[0]``, ``net[-1]``, ``net[1:3]`` is a Sequential),
    sliceable, extendable (``append`` / ``insert`` / ``extend`` / ``pop``),
    and concatenates with ``+``.
    

## `__init__`

```python
__init__(self, *args: 'Any') -> 'None'
```

Initialize self.  See help(type(self)) for accurate signature.

## `append`

```python
append(self, module: 'Module') -> "'Sequential'"
```

append(module) -> Sequential

Add ``module`` at the end; returns the container.

## `extend`

```python
extend(self, sequential: 'Iterable[Module]') -> "'Sequential'"
```

extend(modules) -> Sequential

Append every module of ``modules`` in order; returns the container.

## `forward`

```python
forward(self, input: 'Any') -> 'Any'
```

forward(input) -> Any

Feed ``input`` through every module in order; each output is the
next module's input.

## `insert`

```python
insert(self, index: 'int', module: 'Module') -> "'Sequential'"
```

insert(index, module) -> Sequential

Insert ``module`` before position ``index`` (negative counts from
the end); returns the container.

## `pop`

```python
pop(self, key: 'int | slice') -> 'Module'
```

pop(key) -> Module

Remove and return the module at ``key``.
