code: def affect_init(
      r_weight, i_weight, j_weight, k_weight, init_func, init_criterion
  ):
      """Applies the weight initialization function given to the parameters.
  
      Arguments
      ---------
      r_weight : torch.Parameters
          (nb_quaternion_in, nb_quaternion_out)
      i_weight : torch.Parameters
          (nb_quaternion_in, nb_quaternion_out)
      j_weight : torch.Parameters
          (nb_quaternion_in, nb_quaternion_out)
      k_weight : torch.Parameters
          (nb_quaternion_in, nb_quaternion_out)
      init_func : function
          (unitary_init, quaternion_init)
      init_criterion : str
          (glorot, he)
      """
  
      r, i, j, k = init_func(
          r_weight.size(0),
          r_weight.size(1),
          None,
          init_criterion,
      )
  
      r_weight.data = r.type_as(r_weight.data)
      i_weight.data = i.type_as(i_weight.data)
      j_weight.data = j.type_as(j_weight.data)
      k_weight.data = k.type_as(k_weight.data)
  
file_path: speechbrain/speechbrain/nnet/quaternion_networks/q_ops.py
imports: import torch
  import math
  import numpy
  import torch.nn.functional
  from scipy.stats import chi
  from torch.autograd import Variable
label_desc: Use image node_id 7 for calling a global function with example usage: affect_init(r_weight, i_weight, j_weight, k_weight, init_func, init_criterion) without return types