def _cuda(self, device=None, async=False):
 if self.is_cuda:
  if (device is None):
   device = torch.cuda.current_device()
  if (self.get_device() != device):
   with torch.cuda.device(device):
    return type(self)(self.size()).copy_(self, async)
  else:
   return self
 else:
  if (device is None):
   device = (-1)
  with torch.cuda.device(device):
   return self.type(getattr(torch.cuda, self.__class__.__name__), async)

def _cuda ( self , device = None , async = False ) : if self . is_cuda : if ( device is None ) : device = torch . cuda . current_device ( ) if ( self . get_device ( ) != device ) : with torch . cuda . device ( device ) : return type ( self ) ( self . size ( ) ) . copy_ ( self , async ) else : return self else : if ( device is None ) : device = ( - 1 ) with torch . cuda . device ( device ) : return self . type ( getattr ( torch . cuda , self . __class__ . __name__ ) , async )
returns a copy of this object in cuda memory .