# Changing layer size without declaring it again

**URL:** <https://discuss.pytorch.org/t/changing-layer-size-without-declaring-it-again/11890>\
**Category:** Uncategorized\
**Created:** [January 5, 2018, 12:37am UTC](https://discuss.pytorch.org/t/changing-layer-size-without-declaring-it-again/11890 "2018-01-05T00:37:07Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![SimonW](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/simonw/32/1702_2.png) [@SimonW](https://discuss.pytorch.org/u/SimonW)\
**Post date:** [January 5, 2018, 8:21pm UTC](https://discuss.pytorch.org/t/changing-layer-size-without-declaring-it-again/11890/2 "2018-01-05T20:21:38Z")

</div>

If all `Conv2d` class attrs are correctly set, then this will be fine. However, when you need flexibility like this, I recommend using the functional form where you can manually pass in the weight and bias tensors ([http://pytorch.org/docs/master/nn.html#torch.nn.functional.conv2d](http://pytorch.org/docs/master/nn.html#torch.nn.functional.conv2d))

---

_[View the full topic](https://discuss.pytorch.org/t/changing-layer-size-without-declaring-it-again/11890)._
