code: def run_batched_dot(lib, I, E, W, X, dtype):
      devI = lib.array(I, dtype=dtype)
      devE = lib.array(E, dtype=dtype)
      devW = lib.array(W, dtype=dtype)
  
      devO = lib.zeros(E.shape, dtype=dtype)
      devB = lib.zeros(I.shape, dtype=dtype)
      devU = lib.zeros(W.shape, dtype=dtype)
  
      if lib.__class__.__name__.endswith(
          "CPU"
      ) | lib.__class__.__name__.endswith("MKL"):
          lib.batched_dot(devW, devI, devO)  # fprop
          lib.batched_dot(devW.T, devE, devB)  # bprop
          lib.batched_dot(devE, devI.T, devU)  # update
      elif lib.__class__.__name__.endswith("GPU"):
          lib.batched_dot(devW, devI, devO, size=size)  # fprop
          lib.batched_dot(devW.T, devE, devB, size=size)  # bprop
          lib.batched_dot(devE, devI.T, devU, size=size)  # update
      else:
          for i in range(X):
              devO[i] = np.dot(W, I[i])  # fprop
              devB[i] = np.dot(W.T, E[i])  # bprop
              devU += np.dot(E[i], I[i].T)  # update
  
      return devO, devB, devU
  
file_path: neon/tests/test_backend_batched_dot.py
imports: from __future__ import print_function
  import numpy
  import pytest
  from utils import tensors_allclose
label_desc: Use image node_id 2 for calling a global function with example usage: run_batched_dot(lib, I, E, W, X, dtype) and returns: devO,  devB,  devU