This works for 2d tensorsof size [B,D] with the first dimension as the batch size[B] -
size_t1 is the D
def kronecker_product(t1, t2,size_t1,size_t2):
    fusion_tensor = torch.bmm(t1.unsqueeze(2), t2.unsqueeze(1))
    fusion_tensor = fusion_tensor.view(-1, size_t1 * size_t2)
    return fusion_tensor