code: def inference(cls, architecture, path, image_path):
      model = torch.load(path)
  
      model.eval()
  
      import numpy as np
  
      func = TestKit.preprocess_func["pytorch"][architecture]
      img = func(image_path)
      img = np.transpose(img, (2, 0, 1))
  
      img = np.expand_dims(img, 0).copy()
  
      data = torch.from_numpy(img)
      data = torch.autograd.Variable(data, requires_grad=False)
  
      predict = model(data).data.numpy()
      predict = np.squeeze(predict)
  
      return predict
  
file_path: MMdnn/mmdnn/conversion/examples/pytorch/extractor.py
imports: from __future__ import absolute_import
  import os
  from mmdnn.conversion.examples.imagenet_test import TestKit
  from mmdnn.conversion.examples.extractor import base_extractor
  from mmdnn.conversion.common.utils import download_file
  import torch
  import torchvision.models
label_desc: Use image node_id 3 for calling the pytorch_extractor obj's underlying member method code with example usage: obj.inference(cls, architecture, path, image_path) and returns: predict