code: def test_multidimensional_indexing():
      import numpy.array_api as np
  
      embedding_bhwc = (
          +arange_at_position(np, 4, 0, 2) * 1000
          + arange_at_position(np, 4, 1, 3) * 100
          + arange_at_position(np, 4, 2, 5) * 10
          + arange_at_position(np, 4, 3, 7) * 1
      )
  
      hindices_bt = np.reshape(np.arange(6), (2, 3)) % 3
      windices_bt = np.reshape(np.arange(6), (2, 3)) % 5
  
      # imagine that you have pairs of image <> sentence
      # your goal is to get most suitable token from image for every token in sentence
      # thus for every token in sentence you compute best k and v
  
      result = einindex(
          "c t b <- b h w c, [h, w] b t",
          embedding_bhwc,
          [hindices_bt, windices_bt],
      )
      # example of using a single array for indexing multiple axes
      hw_indices_bt = np.stack([hindices_bt, windices_bt])
      result2 = einindex(
          "c t b <- b h w c, [h, w] b t", embedding_bhwc, hw_indices_bt
      )
      assert np.all(result == result2)
  
      # check vs manual element computation
      result_manual = result * 0
      for b in range(2):
          for t in range(3):
              for c in range(7):
                  h = hindices_bt[b, t]
                  w = windices_bt[b, t]
                  result_manual[c, t, b] = embedding_bhwc[b, h, w, c]
  
      assert np.all(result == result_manual)
  
file_path: einops/einops/experimental/indexing.py
imports: from typing import List, Union, TypeVar, Tuple
  from einops import EinopsError
label_desc: Use image node_id 5 for calling a global function with example usage: test_multidimensional_indexing() without return types