# \[ux\] Mix of nn.Sequential and nn.ModuleDict?

**URL:** <https://discuss.pytorch.org/t/ux-mix-of-nn-sequential-and-nn-moduledict/104724>\
**Category:** Uncategorized\
**Created:** [December 1, 2020, 9:10am UTC](https://discuss.pytorch.org/t/ux-mix-of-nn-sequential-and-nn-moduledict/104724 "2020-12-01T09:10:44Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![ptrblck](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/ptrblck/32/1823_2.png) [@ptrblck](https://discuss.pytorch.org/u/ptrblck)\
**Post date:** [December 4, 2020, 5:50am UTC](https://discuss.pytorch.org/t/ux-mix-of-nn-sequential-and-nn-moduledict/104724/2 "2020-12-04T05:50:52Z")

</div>

Would it work to pass the `OrderedDict` directly to `nn.Sequential` as described in the [docs](https://pytorch.org/docs/stable/generated/torch.nn.Sequential.html?highlight=sequential#torch.nn.Sequential)?

```python
# Example of using Sequential with OrderedDict
model = nn.Sequential(OrderedDict([
          ('conv1', nn.Conv2d(1,20,5)),
          ('relu1', nn.ReLU()),
          ('conv2', nn.Conv2d(20,64,5)),
          ('relu2', nn.ReLU())
        ]))

```

---

_[View the full topic](https://discuss.pytorch.org/t/ux-mix-of-nn-sequential-and-nn-moduledict/104724)._
