class_docstr: Hook to convert a task model into torch script.
  
  Saves the torch scripts in torchscript_folder.
class_docstr_tok: ["Hook","to","convert","a","task","model","into","torch","script",".","Saves","the","torch","scripts","in","torchscript_folder","."]
code: def save_torchscript(self, task) -> None:
      model = task.base_model
      torchscript = (
          self.torchscript_using_trace(model)
          if self.use_trace
          else self.torchscript_using_script(model)
      )
  
      # save torchscript:
      logging.info(
          "Saving torchscript to '{}'...".format(
              self.torchscript_folder
          )
      )
      torchscript = torchscript.to(self.device)
      torchscript_name = f"{self.torchscript_folder}/{TORCHSCRIPT_FILE}"
      with PathManager.open(torchscript_name, "wb") as f:
          torch.jit.save(torchscript, f)
  
file_path: ClassyVision/classy_vision/hooks/torchscript_hook.py
imports: import logging
  import torch
  from classy_vision.generic.distributed_util import is_primary
  from classy_vision.generic.util import eval_model, get_model_dummy_input
  from classy_vision.hooks import register_hook
  from classy_vision.hooks.classy_hook import ClassyHook
  from fvcore.common.file_io import PathManager
label_desc: Use image node_id 4 for calling the TorchscriptHook obj's underlying member method code with example usage: obj.save_torchscript(task) without return types