Fix unused variable warning (#46838)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/46838
`SCALAR_TYPE` may be unused in some contexts where the macro is used. We use the standard `(void)var` trick to suppress the compiler warning in these instances.
Test Plan: Standard pre-commit tests.
Reviewed By: jerryzh168
Differential Revision: D24481142
fbshipit-source-id: 4fcde669cc279b8863443d49c51edaee69f4d7bd