code: def test_invalid_ndim(self):
      x_data = numpy.zeros((3, 2, 5), dtype=numpy.float32)
      y_data = numpy.zeros((3, 5), dtype=numpy.float32)
      x = chainer.Variable(x_data)
      y = chainer.Variable(y_data)
  
      with self.assertRaises(type_check.InvalidType):
          F.matmul(x, y)
  
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 TestMatMulInvalid obj's underlying member method code with example usage: obj.test_invalid_ndim() without return types