parameters: (self)
return_statement: return kl_loss
docstring: Compute kl loss
docstring_summary: Compute kl loss
docstring_tokens: Compute kl loss
function: def compute_kl_loss(self):
          """Compute kl loss"""
          weight_type = self.weight_posterior("get_dist_type")
          weight_args_list = self.weight_posterior("get_dist_args")
  
          kl = self.weight_prior("kl_loss", weight_type, *weight_args_list)
          kl_loss = self.sum(kl)
          if self.has_bias:
              bias_args_list = self.bias_posterior("get_dist_args")
              bias_type = self.bias_posterior("get_dist_type")
  
              kl = self.bias_prior("kl_loss", bias_type, *bias_args_list)
              kl = self.sum(kl)
              kl_loss += kl
          return kl_loss
function_tokens: def compute_kl_loss ( self ) : weight_type = self . weight_posterior ( "get_dist_type" ) weight_args_list = self . weight_posterior ( "get_dist_args" ) kl = self . weight_prior ( "kl_loss" , weight_type , * weight_args_list ) kl_loss = self . sum ( kl ) if self . has_bias : bias_args_list = self . bias_posterior ( "get_dist_args" ) bias_type = self . bias_posterior ( "get_dist_type" ) kl = self . bias_prior ( "kl_loss" , bias_type , * bias_args_list ) kl = self . sum ( kl ) kl_loss += kl return kl_loss