code: def test_boolean_index_autograd():
      a = np.random.uniform(size=(3, 4, 5))
      a.attach_grad()
      with mx.autograd.record():
          out_mx = a[a < 0.5]
      out_mx.backward()
  
      a_np = a.asnumpy()
      out_np = a_np[a_np < 0.5]
      assert_almost_equal(
          out_mx.asnumpy(),
          out_np,
          rtol=1e-4,
          atol=1e-5,
          use_broadcast=False,
      )
  
      a_grad_np = _np.zeros(a.shape, dtype=a.dtype)
      a_grad_np[a_np < 0.5] = 1
      assert_almost_equal(
          a.grad.asnumpy(),
          a_grad_np,
          rtol=1e-4,
          atol=1e-5,
          use_broadcast=False,
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  import itertools
  import os
  import pytest
  import operator
  import numpy
  import mxnet
  from mxnet import np, npx, autograd
  from mxnet.gluon import HybridBlock
  from mxnet.test_utils import same, assert_almost_equal, rand_shape_nd, rand_ndarray, use_np
  from common import retry, TemporaryDirectory, xfail_when_nonstandard_decimal_separator
  from mxnet.test_utils import verify_generator, gen_buckets_probs_with_ppf, assert_exception, is_op_runnable, collapse_sum_like
  from mxnet.ndarray.ndarray import py_slice
  from mxnet.base import integer_types
label_desc: Use image node_id 23 for calling a global function with example usage: test_boolean_index_autograd() without return types