Add inplace option for torch.nn.Hardsigmoid and torch.nn.Hardswish layers (#42346)
Summary:
**`torch.nn.Hardsigmoid`** and **`torch.nn.Hardswish`** classes currently do not support `inplace` operations as it uses `torch.nn.functional.hardsigmoid` and `torch.nn.functional.hardswish` functions with their default inplace argument which is `False`.
So, I added `inplace` argument for `torch.nn.Hardsigmoid` and `torch.nn.Hardswish` classes so that forward operation can be done inplace as well while using these layers.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/42346
Reviewed By: izdeby
Differential Revision: D23108487
Pulled By: albanD
fbshipit-source-id: 0767334fa10e5ecc06fada2d6469f3ee1cacd957