Skip to content

Commit

Permalink
implement sequential
Browse files Browse the repository at this point in the history
Mentioned in #21
  • Loading branch information
albertz committed Oct 28, 2021
1 parent acf27c5 commit 9d3b5f0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion nn/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""

from __future__ import annotations
from .base import Module, ILayerMaker, LayerRef
from .base import Module, ILayerMaker, LayerRef, Layer
from typing import Iterable, Iterator, Union, Dict, Callable


Expand Down Expand Up @@ -81,6 +81,13 @@ def forward(self, inp) -> LayerRef:
return inp


def sequential(source: LayerRef, *modules) -> Layer:
"""
Wraps ``Sequential(*modules)(source)``
"""
return Sequential(*modules)(source)


def _convert_to_maker(obj: _ModT) -> ILayerMaker:
if isinstance(obj, ILayerMaker):
return obj
Expand Down

0 comments on commit 9d3b5f0

Please sign in to comment.