code: def test_getitem_hybridized_no_F_argument():
      class picking_np(HybridBlock):
          def __init__(self, **kwargs):
              super(picking_np, self).__init__(**kwargs)
  
          def forward(self, sequence, pick_ids):
              """
              new implementation in deep numpy
              """
              idx_arange = mx.npx.arange_like(
                  pick_ids.reshape((-1,)), axis=0
              )
              batch_idx = np.floor(idx_arange / 2).astype(np.int32)
  
              encoded = sequence[batch_idx, pick_ids.reshape((-1,))]
              encoded = mx.npx.reshape_like(
                  encoded,
                  pick_ids,
                  lhs_begin=-2,
                  lhs_end=-1,
                  rhs_begin=0,
              )
              return encoded
  
      sequence = mx.nd.array(
          np.random.normal(0, 1, (8, 32, 768)), dtype=np.float32
      )
      # pick_ids: [batch_size, picked_index]
      pick_ids = mx.nd.random.randint(0, 32, (8, 2), dtype=np.int32)
  
      mx.npx.set_np()
      picker_np = picking_np()
      seq_np = sequence.as_np_ndarray()
      np_output = picker_np(seq_np, pick_ids.as_np_ndarray())
      seq_np.attach_grad()
      with mx.autograd.record():
          z = picker_np(seq_np, pick_ids.as_np_ndarray())
      z.backward()
  
      picker_np.initialize()
      picker_np.hybridize()
      nd_output_hybridized = picker_np(
          sequence.as_np_ndarray(), pick_ids.as_np_ndarray()
      )
      seq_np_hybridized = sequence.as_np_ndarray()
      seq_np_hybridized.attach_grad()
      with mx.autograd.record():
          z_hybridized = picker_np(
              seq_np_hybridized, pick_ids.as_np_ndarray()
          )
      z_hybridized.backward()
      mx.npx.reset_np()
  
      mx.test_utils.assert_almost_equal(
          nd_output_hybridized.asnumpy(), np_output.asnumpy()
      )
      mx.test_utils.assert_almost_equal(
          z_hybridized.asnumpy(), np_output.asnumpy()
      )
      mx.test_utils.assert_almost_equal(
          seq_np.grad.asnumpy(), seq_np_hybridized.grad.asnumpy()
      )
  
imports: import pytest
  import numpy
  import mxnet
  from mxnet.gluon import HybridBlock
label_desc: Use image node_id 2 for calling a global function with example usage: test_getitem_hybridized_no_F_argument() and returns: encoded