code: def np_dot(a, b, axes):
      if isinstance(axes, int):
          axes = (axes, axes)
      axes = [axis if axis < 0 else axis - 1 for axis in axes]
      res = np.stack(
          [np.tensordot(a[i], b[i], axes) for i in range(a.shape[0])]
      )
      if len(res.shape) == 1:
          res = np.expand_dims(res, axis=1)
      return res
  
file_path: keras/keras/layers/merging/merging_test.py
imports: import numpy
  import pytest
  from absl.testing import parameterized
  from keras import backend
  from keras import layers
  from keras import models
  from keras import testing
label_desc: Use image node_id 1 for calling a global function with example usage: np_dot(a, b, axes) and returns: res