code: def forward_expected(self, inputs):
      x1, x2 = inputs
      x1 = x1.reshape(x1.shape[:2] + (-1,))
      if self.transa:
          x1 = x1.swapaxes(-1, -2)
  
      x2 = x2.reshape(x2.shape[:2] + (-1,))
      if self.transb:
          x2 = x2.swapaxes(-1, -2)
  
      y_expect = numpy.einsum("...ij,...jk->...ik", x1, x2)
      return (y_expect,)
  
imports: import unittest
  import numpy
  import chainer
  from chainer.backend import CpuDevice
  import chainer.functions
  from chainer import testing
  from chainer.utils import type_check
label_desc: Use image node_id 2 for calling the TestBatchMatMul obj's underlying member method code with example usage: obj.forward_expected(inputs) and returns: y_expect