Skip to content

Latest commit

History

History
33 lines (26 loc) 路 692 Bytes

Repeat.mdx

File metadata and controls

33 lines (26 loc) 路 692 Bytes

import { Callout } from "nextra-theme-docs" import { Tab, Tabs } from "nextra-theme-docs"

Repeat

Repeat the given module depth times.

Repeat(
    nn.Sequential(
        nn.Linear(100, 200),
        nn.GELU(),
        nn.Linear(200, 100)
    ),
    depth=12
)

Repeat creates multiple copies of the children and applies them sequentially. Every copy of children will be re-instantiated based on its configuration. The input and output shapes of the children must be the same in order to be applied in this way.

Parameters

  • children: The module to be repeated.
  • depth: The number of copies of children to create.

Forward

() -> Any