Replace assertEqualIgnoreType in test_nn.py (#90242)
See https://github.com/pytorch/pytorch/issues/38095.
Also removed some redundant separate `dtype` checks when `dtype` is already checked by the next line's `assertEqual`.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/90242
Approved by: https://github.com/malfet