@require_context
def to_device(obj, stream=0, copy=True, to=None):
 if (to is None):
  (to, new) = devicearray.auto_device(obj, stream=stream, copy=copy)
  return to
 if copy:
  to.copy_to_device(obj, stream=stream)
 return to

@ require_context def to_device ( obj , stream = 0 , copy = True , to = None ) : if ( to is None ) : ( to , new ) = devicearray . auto_device ( obj , stream = stream , copy = copy ) return to if copy : to . copy_to_device ( obj , stream = stream ) return to
to_device allocate and transfer a numpy ndarray or structured scalar to the device .