parameters: (n_classes)
return_statement: return _dnn_to_tree_cross_entropy_loss
docstring: Returns a cross entropy loss function for dnn to tree distillation.
docstring_summary: Returns a cross entropy loss function for dnn to tree distillation.
docstring_tokens: Returns a cross entropy loss function for dnn to tree distillation .
function: def create_dnn_to_tree_cross_entropy_loss_fn(n_classes):
    """Returns a cross entropy loss function for dnn to tree distillation."""
  
    def _dnn_to_tree_cross_entropy_loss(dnn_logits, tree_logits, example_weights):
      if n_classes == 2:
        return head_lib._log_loss_with_two_classes(  # pylint: disable=protected-access
            labels=_logits_to_label_for_tree(dnn_logits, n_classes),
            logits=tree_logits,
            weights=example_weights)[0]
      else:
        return head_lib._softmax_cross_entropy_loss(  # pylint: disable=protected-access
            labels=_logits_to_label_for_tree(dnn_logits, n_classes),
            logits=tree_logits,
            weights=example_weights)[0]
  
    return _dnn_to_tree_cross_entropy_loss
function_tokens: def create_dnn_to_tree_cross_entropy_loss_fn ( n_classes ) : def _dnn_to_tree_cross_entropy_loss ( dnn_logits , tree_logits , example_weights ) : if n_classes == 2 : return head_lib . _log_loss_with_two_classes ( # pylint: disable=protected-access labels = _logits_to_label_for_tree ( dnn_logits , n_classes ) , logits = tree_logits , weights = example_weights ) [ 0 ] else : return head_lib . _softmax_cross_entropy_loss ( # pylint: disable=protected-access labels = _logits_to_label_for_tree ( dnn_logits , n_classes ) , logits = tree_logits , weights = example_weights ) [ 0 ] return _dnn_to_tree_cross_entropy_loss