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

Rename cuda_gpu_id to device_id in DeviceOption (#12456)

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

codemod with 'Yes to all'
codemod -d . --extensions h,cc,cpp,cu,py,proto,pbtxt,pb.txt,config cuda_gpu_id device_id

Overload TextFormat::ParseFromString to do string replace when parsing from protobuf format

Reviewed By: Yangqing

Differential Revision: D10240535

fbshipit-source-id: 5e6992bec961214be8dbe26f16f5794154a22b25
parent a4b7b279
...@@ -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.cuda_gpu_id = gpu_id device_option.device_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