code: def ref_unpooling(x, kernel, channel_last):
      if channel_last:
          n_sdim = len(kernel)
          t = refs.ChannelLastToFirstTranspose(x.ndim, n_sdim)
          x = t(x)
      y = x
      for ind, p in enumerate(kernel[::-1]):
          y = y.repeat(p, axis=y.ndim - (ind + 1))
      if channel_last:
          y = t.inv(y)
      return y
  
file_path: nnabla/python/test/function/test_unpooling.py
imports: import pytest
  import numpy
  import nnabla.functions
  import refs
  from nbla_test_utils import list_context
label_desc: Use image node_id 1 for calling a global function with example usage: ref_unpooling(x, kernel, channel_last) and returns: y