minir edit to fix benchmark_all_test cuda error (#29829)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/29829
This diff replaces the if check cuda with to(device...) which is a much cleaner interface.
Test Plan:
```
buck run mode/opt //caffe2/benchmarks/operator_benchmark:benchmark_all_test -- --iterations 1
# ----------------------------------------
# PyTorch/Caffe2 Operator Micro-benchmarks
# ----------------------------------------
# Tag : short
# Benchmarking PyTorch: add
# Mode: Eager
# Name: add_M64_N64_K64_cpu
# Input: M: 64, N: 64, K: 64, device: cpu
Forward Execution Time (us) : 129.548
# Benchmarking PyTorch: add
# Mode: Eager
# Name: add_M64_N64_K64_cuda
# Input: M: 64, N: 64, K: 64, device: cuda
Forward Execution Time (us) : 48.313
...
Reviewed By: bddppq
Differential Revision: D18507568
fbshipit-source-id: 32534e76b2e27d59a631a4d76a0d93700e975ea4