code: def _multiscale_predict(predict_method, img, scales):
      orig_H, orig_W = img.shape[1:]
      scores = []
      orig_img = img
      for scale in scales:
          img = orig_img.copy()
          if scale != 1.0:
              img = transforms.resize(
                  img, (int(orig_H * scale), int(orig_W * scale))
              )
          # This method should return scores
          y = predict_method(img)[None]
          assert y.shape[2:] == img.shape[1:]
  
          if scale != 1.0:
              y = F.resize_images(y, (orig_H, orig_W)).array
          scores.append(y)
      xp = chainer.backends.cuda.get_array_module(scores[0])
      scores = xp.stack(scores)
      return scores.mean(0)[0]
  
imports: from __future__ import division
  from math import ceil
  import numpy
  import chainer
  import chainer.functions
  from chainer import initializers
  import chainer.links
  from chainercv.experimental.links.model.pspnet.transforms import convolution_crop
  from chainercv.links import Conv2DBNActiv
  from chainercv.links.model.resnet import ResBlock
  from chainercv.links import PickableSequentialChain
  from chainercv import transforms
  from chainercv import utils
label_desc: Use image node_id 1 for calling a global function with example usage: _multiscale_predict(predict_method, img, scales) and returns: scores