class_docstr: This is a base class used to create Caffe2 operator benchmark
class_docstr_tok: ["This","is","a","base","class","used","to","create","Caffe2","operator","benchmark"]
docstr: This method is used to set device option.
docstr_tok: ["This","method","is","used","to","set","device","option","."]
code: def _device_option(self, device):
      """This method is used to set device option."""
      if device not in ["cuda", "cpu"]:
          raise ValueError("Missing attrs in configs")
  
      if "cuda" in device:
          self.dev = core.DeviceOption(caffe2_pb2.CUDA, 0)
      else:
          self.dev = core.DeviceOption(caffe2_pb2.CPU)
      return self.dev
  
imports: from collections import namedtuple
  import benchmark_utils
  from benchmark_test_generator import _register_test
  from caffe2.proto import caffe2_pb2
  from caffe2.python import core, workspace
  from .benchmark_core import TestConfig
label_desc: Use image node_id 3 for calling the Caffe2BenchmarkBase obj's underlying member method code with example usage: obj._device_option(device) and returns: self