Switch to use nested tensor by-default in TransformerEncoder (#77217)
Summary: Switch to use nested tensor as by default setting in TransformerEncoderLayer.
Test Plan:
CI
Torchtext
buck test mode/opt pytorch/text/test:integration_tests_test_models -- test_xlmr_base_model
Reviewed By: frank-wei
Differential Revision: D36153335
Pull Request resolved: https://github.com/pytorch/pytorch/pull/77217
Approved by: https://github.com/cpuhrsch