Commit 96147dec authored by Junjie Bai's avatar Junjie Bai Committed by Facebook Github Bot

Back out "Revert D10123245: Back out "codemod cuda_gpu_id to device_id"" (#12232)

Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/12232

Original commit changeset: fca91fea58b7

This adds proper modifications to the DeviceType <->DeviceOption conversion code added in D10033396

Reviewed By: jerryzh168

Differential Revision: D10132473

fbshipit-source-id: 801ef777e2950982cb47b48051b1471a0a91e64b
parent 1afde377
...@@ -343,7 +343,7 @@ def get_device_option_cpu(): ...@@ -343,7 +343,7 @@ def get_device_option_cpu():
def get_device_option_cuda(gpu_id=0): def get_device_option_cuda(gpu_id=0):
device_option = caffe2_pb2.DeviceOption() device_option = caffe2_pb2.DeviceOption()
device_option.device_type = caffe2_pb2.CUDA device_option.device_type = caffe2_pb2.CUDA
device_option.device_id = gpu_id device_option.cuda_gpu_id = gpu_id
return device_option return device_option
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment