code: def test_pixelshuffle2d():
      nchan = 2
      up_x = 2
      up_y = 3
      nx = 2
      ny = 3
      shape_before = (1, nchan * up_x * up_y, nx, ny)
      shape_after = (1, nchan, nx * up_x, ny * up_y)
      layer = nn.PixelShuffle2D((up_x, up_y))
      x = mx.np.reshape(
          mx.np.arange(_np.prod(shape_before)), shape_before
      )
      y = layer(x)
      assert y.shape == shape_after
      # - Channels are reshaped to form 2x3 blocks
      # - Within each block, the increment is `nx * ny` when increasing the column
      #   index by 1
      # - Increasing the block index adds an offset of 1
      # - Increasing the channel index adds an offset of `nx * up_x * ny * up_y`
      assert_allclose(
          y,
          [
              [
                  [
                      [0, 6, 12, 1, 7, 13, 2, 8, 14],
                      [18, 24, 30, 19, 25, 31, 20, 26, 32],
                      [3, 9, 15, 4, 10, 16, 5, 11, 17],
                      [21, 27, 33, 22, 28, 34, 23, 29, 35],
                  ],
                  [
                      [36, 42, 48, 37, 43, 49, 38, 44, 50],
                      [54, 60, 66, 55, 61, 67, 56, 62, 68],
                      [39, 45, 51, 40, 46, 52, 41, 47, 53],
                      [57, 63, 69, 58, 64, 70, 59, 65, 71],
                  ],
              ]
          ],
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  import os
  from uuid import uuid4
  import numpy
  import mxnet
  from mxnet import gluon, autograd, np, npx
  from mxnet.test_utils import use_np, assert_almost_equal, check_gluon_hybridize_consistency, assert_allclose
  from mxnet.gluon import nn
  from mxnet.base import MXNetError
  import random
  import pytest
label_desc: Use image node_id 24 for calling a global function with example usage: test_pixelshuffle2d() without return types