Amend docstring and add test for Flatten module (#42084)
Summary:
I've noticed when PR https://github.com/pytorch/pytorch/issues/22245 introduced `nn.Flatten`, the docstring had a bug where it wouldn't render properly on the web, and this PR addresses that. Additionally, it adds a unit test for this module.
**Actual**
![image](https://user-images.githubusercontent.com/13088001/88483672-cf896a00-cf3f-11ea-8b1b-a30d152e1368.png)
**Expected**
![image](https://user-images.githubusercontent.com/13088001/88483642-86391a80-cf3f-11ea-8333-0964a027a172.png)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/42084
Reviewed By: mrshenli
Differential Revision: D22756662
Pulled By: ngimel
fbshipit-source-id: 60c58c18c9a68854533196ed6b9e9fb0d4f83520