parameters: (self,
                            features,
                            mode,
                            labels=None,
                            train_op_fn=None,
                            logits=None,
                            logits_input=None,
                            scope=None)
return_statement: return model_fn.ModelFnOps(
          mode=mode,
          loss=loss,
          train_op=train_op,
          predictions={},
          eval_metric_ops={})
docstring: See `_Head.create_model_fn_ops`.
  
      Args:
        features: Not been used.
        mode: Estimator's `ModeKeys`.
        labels: Labels `Tensor`, or `dict` of same.
        train_op_fn: Function that takes a scalar loss and returns an op to
            optimize with the loss.
        logits: Not been used.
        logits_input: Not been used.
        scope: Optional scope for variable_scope. If provided, will be passed to
            all heads. Most users will want to set this to `None`, so each head
            constructs a separate variable_scope according to its `head_name`.
  
      Returns:
        A `ModelFnOps` object.
  
      Raises:
        ValueError: if `mode` is not recognition.
docstring_summary: See `_Head.create_model_fn_ops`.
docstring_tokens: See _Head . create_model_fn_ops .
function: def create_model_fn_ops(self,
                            features,
                            mode,
                            labels=None,
                            train_op_fn=None,
                            logits=None,
                            logits_input=None,
                            scope=None):
      """See `_Head.create_model_fn_ops`.
  
      Args:
        features: Not been used.
        mode: Estimator's `ModeKeys`.
        labels: Labels `Tensor`, or `dict` of same.
        train_op_fn: Function that takes a scalar loss and returns an op to
            optimize with the loss.
        logits: Not been used.
        logits_input: Not been used.
        scope: Optional scope for variable_scope. If provided, will be passed to
            all heads. Most users will want to set this to `None`, so each head
            constructs a separate variable_scope according to its `head_name`.
  
      Returns:
        A `ModelFnOps` object.
  
      Raises:
        ValueError: if `mode` is not recognition.
      """
      _check_mode_valid(mode)
      loss = None
      train_op = None
      if mode != model_fn.ModeKeys.INFER:
        with variable_scope.variable_scope(scope, default_name=self.head_name):
          loss = self._loss_fn()
          if isinstance(loss, list):
            loss = math_ops.add_n(loss)
          # The name_scope escapism is needed to maintain the same summary tag
          # after switching away from the now unsupported API.
          with ops.name_scope(""):
            summary_loss = array_ops.identity(loss)
            summary.scalar(_summary_key(self.head_name, mkey.LOSS),
                           summary_loss)
          if mode == model_fn.ModeKeys.TRAIN:
            if train_op_fn is None:
              raise ValueError("train_op_fn can not be None in TRAIN mode")
            with ops.name_scope(None, "train_op", (loss,)):
              train_op = train_op_fn(loss)
  
      return model_fn.ModelFnOps(
          mode=mode,
          loss=loss,
          train_op=train_op,
          predictions={},
          eval_metric_ops={})
function_tokens: def create_model_fn_ops ( self , features , mode , labels = None , train_op_fn = None , logits = None , logits_input = None , scope = None ) : _check_mode_valid ( mode ) loss = None train_op = None if mode != model_fn . ModeKeys . INFER : with variable_scope . variable_scope ( scope , default_name = self . head_name ) : loss = self . _loss_fn ( ) if isinstance ( loss , list ) : loss = math_ops . add_n ( loss ) # The name_scope escapism is needed to maintain the same summary tag # after switching away from the now unsupported API. with ops . name_scope ( "" ) : summary_loss = array_ops . identity ( loss ) summary . scalar ( _summary_key ( self . head_name , mkey . LOSS ) , summary_loss ) if mode == model_fn . ModeKeys . TRAIN : if train_op_fn is None : raise ValueError ( "train_op_fn can not be None in TRAIN mode" ) with ops . name_scope ( None , "train_op" , ( loss , ) ) : train_op = train_op_fn ( loss ) return model_fn . ModelFnOps ( mode = mode , loss = loss , train_op = train_op , predictions = { } , eval_metric_ops = { } )