[fix] torch.{lin, log}space(): properly examine passed dtype (#53685)
Summary:
Fixes https://github.com/pytorch/pytorch/issues/53171
Pull Request resolved: https://github.com/pytorch/pytorch/pull/53685
Reviewed By: jbschlosser
Differential Revision: D28331863
Pulled By: anjali411
fbshipit-source-id: e89359b607d058158cfa1c9a82389d9a4a71185b