code: def to(self, device: torch.device, *, use_half: bool) -> None:
      if use_half:
          self.model.half()
      else:
          self.model.float()
      self.model.to(device)
      self.device = device
      self.use_half = use_half
  
file_path: carefree-learn/cflearn/api/cv/third_party/mlsd/api.py
imports: import os
  import torch
  import numpy
  from .utils import pred_lines
  from .models.mbv2_mlsd_large import MobileV2_MLSD_Large
  from .....misc.toolkit import download_model
label_desc: Use image node_id 2 for calling the MLSDDetector obj's underlying member method code with example usage: obj.to(device) without return types