mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
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:
committed by
PyTorch MergeBot
parent
32fc0b958e
commit
4a5edbf076
@ -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) {
|
||||
|
Reference in New Issue
Block a user