Disallow functions that are in submodules to also be methods
Follows the discussion in https://github.com/pytorch/pytorch/pull/74054
We show that it works by example, given that it caught the
`special_gamma` error.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/75040
Approved by: https://github.com/ezyang