ENH Raises nicer error when calling module.train with invalid modes (#58247)
Summary:
Fixes https://github.com/pytorch/pytorch/issues/46763
Pull Request resolved: https://github.com/pytorch/pytorch/pull/58247
Reviewed By: ejguan
Differential Revision: D28418080
Pulled By: albanD
fbshipit-source-id: fef8f4f641ef75e801ed8b8d04c4016579aea8b0