Make param 'option' const& to prevent unnecessary copy at call-site (#84747)

Reviewed By: ajtulloch

Differential Revision: D39208916

Pull Request resolved: https://github.com/pytorch/pytorch/pull/84747
Approved by: https://github.com/janeyx99
This commit is contained in:
Gavin Wu
2022-09-17 02:11:27 +00:00
committed by PyTorch MergeBot
parent 32fc0b958e
commit 4a5edbf076

View File

@ -108,7 +108,7 @@ inline TORCH_API caffe2::DeviceOption DeviceToOption(const at::Device& device) {
return option;
}
inline TORCH_API at::Device OptionToDevice(const caffe2::DeviceOption option) {
inline TORCH_API at::Device OptionToDevice(const caffe2::DeviceOption& option) {
auto type = option.device_type();
c10::DeviceIndex id = -1;
switch (type) {