code: def test_dynamic_shape_backward():
      # test dynamic shape ops with backward prop
      class _TestBlock(gluon.HybridBlock):
          def __init__(self):
              super(_TestBlock, self).__init__()
  
          def forward(self, data, index):
              return mx.np.sum(_npi.boolean_mask(data, index)) - 5
  
      block = _TestBlock()
      for static_alloc in [True, False]:
          block.hybridize(static_alloc=static_alloc)
          data = mx.np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]])
          index = mx.np.array([0, 1, 0])
          data.attach_grad()
          with mx.autograd.record():
              result = block(data, index)
          result.backward()
          result_nd = np.array([10.0])
          data_grad_nd = np.array(
              [[0.0, 0.0, 0.0], [1.0, 1.0, 1.0], [0.0, 0.0, 0.0]]
          )
          assert_almost_equal(result.asnumpy(), result_nd)
          assert_almost_equal(data.grad.asnumpy(), data_grad_nd)
  
file_path: mxnet/tests/python/unittest/test_dynamic_shape.py
imports: import numpy
  import mxnet
  import mxnet.ndarray.numpy._internal
  from mxnet import gluon
  from numpy.testing import assert_allclose, assert_array_equal
  from mxnet.test_utils import *
  from mxnet.base import _as_list
  from mxnet.attribute import AttrScope
label_desc: Use image node_id 5 for calling a global function with example usage: test_dynamic_shape_backward() and returns: unknown