code: def kron(a, b):
      """Kronecker product.
  
      Same as scipy.linalg.kron(a, b).
  
      Parameters
      ----------
      a: array_like
      b: array_like
  
      Returns
      -------
      array_like with a.ndim + b.ndim - 2 dimensions
  
      Notes
      -----
      numpy.kron(a, b) != scipy.linalg.kron(a, b)!
      They don't have the same shape and order when
      a.ndim != b.ndim != 2.
  
      """
      a = tensor.as_tensor_variable(a)
      b = tensor.as_tensor_variable(b)
      if a.ndim + b.ndim <= 2:
          raise TypeError(
              "kron: inputs dimensions must sum to 3 or more. "
              "You passed %d and %d." % (a.ndim, b.ndim)
          )
      o = tensor.outer(a, b)
      o = o.reshape(
          tensor.concatenate((a.shape, b.shape)), a.ndim + b.ndim
      )
      shf = o.dimshuffle(0, 2, 1, *list(range(3, o.ndim)))
      if shf.ndim == 3:
          shf = o.dimshuffle(1, 0, 2)
          o = shf.flatten()
      else:
          o = shf.reshape(
              (o.shape[0] * o.shape[2], o.shape[1] * o.shape[3])
              + tuple(o.shape[i] for i in xrange(4, o.ndim))
          )
      return o
  
imports: from __future__ import absolute_import, print_function, division
  import logging
  import warnings
  from six.moves import xrange
  import numpy
  from theano import tensor
  import theano.tensor
  from theano.tensor import as_tensor_variable
  from theano.gof import Op, Apply
label_desc: Use image node_id 2 for calling a global function with example usage: kron(a, b) and returns: o