code: def test_gluon_boolean_mask():
      class Foo(HybridBlock):
          def forward(self, data, indices):
              mask = indices < 3
              data = npx.reshape(data, (-1, -2), reverse=True)
              mask = np.reshape(mask, (-1,))
              sel = nd.np._internal.boolean_mask(data, mask)
              return sel
  
      data = mx.np.random.normal(0, 1, (5, 5, 5, 5, 16))
      indices = mx.np.random.randint(0, 5, (5, 5, 5, 5))
      data.attach_grad()
      indices.attach_grad()
      foo = Foo()
      foo.hybridize()
      with mx.autograd.record():
          out = foo(data, indices)
          out.backward()
      out.wait_to_read()
  
file_path: gluon-nlp/tests/test_gluon_block.py
imports: import pytest
  import mxnet
  from mxnet import nd, np, npx
  from mxnet.test_utils import assert_allclose
  from mxnet.gluon import HybridBlock, Constant
  from mxnet.gluon.data import DataLoader
  import itertools
label_desc: Use image node_id 4 for calling a global function with example usage: test_gluon_boolean_mask() and returns: sel