def get_lhs_nonterminal_bias(self,
                               nonterminal_bias=0,
                               min_nonterminal_rule_arity=1):
    """Returns nonterminal bias for each lhs rule embedding."""
    lhs_nonterminal_bias = [0] * self.config["num_lhs_emb"]
    for rule in self.rules:
      rule_idx = self.lhs_emb_idx_map[rule]
      if (isinstance(rule, qcfg_rule.QCFGRule) and
          rule.arity >= min_nonterminal_rule_arity):
        lhs_nonterminal_bias[rule_idx] = nonterminal_bias
    # <float>[1, num_lhs_emb]
    return tf.expand_dims(
        tf.convert_to_tensor(lhs_nonterminal_bias, dtype=tf.float32), 0)
Returns nonterminal bias for each lhs rule embedding.
language/compgen/csl/model/inference/inference_wrapper.py