code: def inceptionresnetv2(num_classes=1001, pretrained="imagenet"):
      r"""InceptionResNetV2 model architecture from the
      `"InceptionV4, Inception-ResNet..." <https://arxiv.org/abs/1602.07261>`_ paper.
      """
      if pretrained:
          settings = pretrained_settings["inceptionresnetv2"][
              pretrained
          ]
          if num_classes != settings["num_classes"]:
              raise AssertionError(
                  "num_classes should be {}, but is {}".format(
                      settings["num_classes"], num_classes
                  )
              )
  
          # both 'imagenet'&'imagenet+background' are loaded from same parameters
          model = InceptionResNetV2(num_classes=1001)
          model.load_state_dict(model_zoo.load_url(settings["url"]))
  
          if pretrained == "imagenet":
              new_last_linear = nn.Linear(1536, 1000)
              new_last_linear.weight.data = (
                  model.last_linear.weight.data[1:]
              )
              new_last_linear.bias.data = model.last_linear.bias.data[
                  1:
              ]
              model.last_linear = new_last_linear
  
          model.input_space = settings["input_space"]
          model.input_size = settings["input_size"]
          model.input_range = settings["input_range"]
  
          model.mean = settings["mean"]
          model.std = settings["std"]
      else:
          model = InceptionResNetV2(num_classes=num_classes)
      return model
  
imports: import torch
  import torch.nn
  import torch.utils.model_zoo
label_desc: Use image node_id 1 for calling a global function with example usage: inceptionresnetv2(num_classes, pretrained) and returns: model