class_docstr: Constructs a device structure.
  
  MXNet can run operations on CPU and different GPUs.
  A Device class describes the device type and ID on which computation should be carried on.
  
  One can use mx.cpu and mx.gpu for short.
  
  See also
  ----------
  `How to run MXNet on multiple CPU/GPUs <http://mxnet.incubator.apache.org/api/faq/distributed_training>`
  for more details.
  
  Parameters
  ----------
  device_type : {'cpu', 'gpu'} or Device.
      String representing the device type.
  
  device_id : int (default=0)
      The device id of the device, needed for GPU.
  
  Note
  ----
  Device can also be used as a way to change the default device.
  
  Examples
  --------
  >>> # array on cpu
  >>> cpu_array = mx.np.ones((2, 3))
  >>> # switch default Device to GPU(2)
  >>> with mx.Device(mx.gpu(2)):
  ...     gpu_array = mx.np.ones((2, 3))
  >>> gpu_array.device
  gpu(2)
  
  One can also explicitly specify the device when creating an array.
  
  >>> gpu_array = mx.np.ones((2, 3), mx.gpu(1))
  >>> gpu_array.device
  gpu(1)
class_docstr_tok: ["Constructs","a","device","structure",".","MXNet","can","run","operations","on","CPU","and","different","GPUs",".","A","Device","class","describes","the","device","type","and","ID","on","which","computation","should","be","carried","on",".","One","can","use","mx.cpu","and","mx.gpu","for","short",".","See","also","--","--","--","--","--","`","How","to","run","MXNet","on","multiple","CPU\/GPUs","<","http",":","\/\/mxnet.incubator.apache.org\/api\/faq\/distributed_training",">","`","for","more","details",".","Parameters","--","--","--","--","--","device_type",":","{","'cpu","'",",","'gpu","'","}","or","Device",".","String","representing","the","device","type",".","device_id",":","int","(","default=0",")","The","device","id","of","the","device",",","needed","for","GPU",".","Note","--","--","Device","can","also","be","used","as","a","way","to","change","the","default","device",".","Examples","--","--","--","--",">",">",">","#","array","on","cpu",">",">",">","cpu_array","=","mx.np.ones","(","(","2",",","3",")",")",">",">",">","#","switch","default","Device","to","GPU","(","2",")",">",">",">","with","mx.Device","(","mx.gpu","(","2",")",")",":","...","gpu_array","=","mx.np.ones","(","(","2",",","3",")",")",">",">",">","gpu_array.device","gpu","(","2",")","One","can","also","explicitly","specify","the","device","when","creating","an","array",".",">",">",">","gpu_array","=","mx.np.ones","(","(","2",",","3",")",",","mx.gpu","(","1",")",")",">",">",">","gpu_array.device","gpu","(","1",")"]
code: def __repr__(self):
      return self.__str__()
  
file_path: mxnet/python/mxnet/device.py
imports: import contextvars
  import ctypes
  from .base import _LIB
  from .base import check_call
label_desc: Use image node_id 6 for calling the Device obj's underlying member method code with example usage: obj.__repr__() and returns: self