code: def download_mobilenet_v3_timm_weights(
      output_path: str, to_torchvision: bool = True
  ):
      timm_model = mobilenetv3_large_100(pretrained=True)
  
      trunk = {}
      heads = {}
      for k, v in timm_model.state_dict().items():
          if k.startswith("conv_head"):
              if k == "conv_head.weight":
                  heads["0.classifier.0.weight"] = v
                  if to_torchvision:
                      heads["0.classifier.0.weight"] = v.squeeze(
                          -1
                      ).squeeze(-1)
                  else:
                      heads["0.classifier.0.weight"] = v
              else:
                  heads["0.classifier.0.bias"] = v
          elif k.startswith("classifier"):
              if to_torchvision:
                  if k == "classifier.weight":
                      heads["0.classifier.3.weight"] = v
                  else:
                      heads["0.classifier.3.bias"] = v
              else:
                  if k == "classifier.weight":
                      heads["0.classifier.4.weight"] = v
                  else:
                      heads["0.classifier.4.bias"] = v
          else:
              trunk[f"model.{k}"] = v
  
      if to_torchvision:
          trunk = ConvertorTimmTV.convert(trunk)
  
      out_cp = {
          "classy_state_dict": {
              "base_model": {
                  "model": {
                      "trunk": trunk,
                      "heads": heads,
                  }
              }
          }
      }
      torch.save(out_cp, output_path)
  
imports: from functools import partial
  from typing import List
  import torch
  import torch.nn
  import torch.nn.functional
  from timm.models.mobilenetv3 import mobilenetv3_large_100
  from torchvision.models import mobilenet_v3_large
  from vissl.config import AttrDict
  from vissl.models.trunks import register_model_trunk
label_desc: Use image node_id 2 for calling a global function with example usage: download_mobilenet_v3_timm_weights(output_path, to_torchvision) without return types