Replace tensor.type().scalarType() calls with tensor.scalar_type()
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/17515
Reviewed By: ezyang
Differential Revision: D14233250
fbshipit-source-id: 6c7af8d2291c0c2b148001b30cf03834f34366c0