Avoid resizing ones array when bias is not used (#48540)
Summary:
https://github.com/pytorch/pytorch/issues/48539
Pull Request resolved: https://github.com/pytorch/pytorch/pull/48540
Reviewed By: zhangguanheng66
Differential Revision: D25255175
Pulled By: ezyang
fbshipit-source-id: 755435a0adf9129a2edbffbad252e95a05e84a5f