code: def kronecker_product(a, b):
      """
      Copied from rabeehk/compacter seq2seq/hypercomplex/kronecker.py
  
      Kronecker product of matrices a and b with leading batch dimensions. Batch dimensions are broadcast. The number of
      them mush :type a: torch.Tensor :type b: torch.Tensor :rtype: torch.Tensor
      """
      siz1 = torch.Size(
          torch.tensor(a.shape[-2:]) * torch.tensor(b.shape[-2:])
      )
      res = a.unsqueeze(-1).unsqueeze(-3) * b.unsqueeze(-2).unsqueeze(
          -4
      )
      siz0 = res.shape[:-4]
      out = res.reshape(siz0 + siz1)
      return out
  
imports: import math
  import torch
  from torch import nn
  from transformers.activations import get_activation
  from ..configuration import AdapterFusionConfig, BnConfig
  from ..context import ForwardContext
label_desc: Use image node_id 2 for calling a global function with example usage: kronecker_product(a, b) and returns: out