class_docstr: Ranking model for groupwise scoring functions.
class_docstr_tok: ["Ranking","model","for","groupwise","scoring","functions","."]
docstr: Constructor for groupwise ranking model.
  
  Args:
    group_score_fn: A scoring function for a `group_size` number of examples
      with the following signature:
      * Args:
        `context_features`: A dict of `Tensor`s with shape [batch_size, ...].
        `group_features`: A dict of `Tensor`s with shape [batch_size,
          group_size, ...]
        `mode`: Optional. Specifies if this is training, evaluation or
          inference. See `ModeKeys`.
        `params`: Optional dict of hyperparameters, same value passed in the
          `Estimator` constructor.
        `config`: Optional configuration object, same value passed in the
          `Estimator` constructor.
      * Returns: A Tensor of shape [batch_size, group_size] that contains a
        score for each example, or a `dict` of Tensors with the above shape in
        multi-task setting.
    group_size: An integer denoting the number of examples in
      `group_score_fn`.
    transform_fn: See `_RankingModel`.
  
  Raises:
    ValueError: when group_size is invalid.
docstr_tok: ["Constructor","for","groupwise","ranking","model",".","Args",":","group_score_fn",":","A","scoring","function","for","a","`","group_size","`","number","of","examples","with","the","following","signature",":","*","Args",":","`","context_features","`",":","A","dict","of","`","Tensor","`","s","with","shape","[","batch_size",",","...","]",".","`","group_features","`",":","A","dict","of","`","Tensor","`","s","with","shape","[","batch_size",",","group_size",",","...","]","`","mode","`",":","Optional",".","Specifies","if","this","is","training",",","evaluation","or","inference",".","See","`","ModeKeys","`",".","`","params","`",":","Optional","dict","of","hyperparameters",",","same","value","passed","in","the","`","Estimator","`","constructor",".","`","config","`",":","Optional","configuration","object",",","same","value","passed","in","the","`","Estimator","`","constructor",".","*","Returns",":","A","Tensor","of","shape","[","batch_size",",","group_size","]","that","contains","a","score","for","each","example",",","or","a","`","dict","`","of","Tensors","with","the","above","shape","in","multi-task","setting",".","group_size",":","An","integer","denoting","the","number","of","examples","in","`","group_score_fn","`",".","transform_fn",":","See","`","_RankingModel","`",".","Raises",":","ValueError",":","when","group_size","is","invalid","."]
code: def __init__(self, group_score_fn, group_size, transform_fn=None):
      """Constructor for groupwise ranking model.
  
      Args:
        group_score_fn: A scoring function for a `group_size` number of examples
          with the following signature:
          * Args:
            `context_features`: A dict of `Tensor`s with shape [batch_size, ...].
            `group_features`: A dict of `Tensor`s with shape [batch_size,
              group_size, ...]
            `mode`: Optional. Specifies if this is training, evaluation or
              inference. See `ModeKeys`.
            `params`: Optional dict of hyperparameters, same value passed in the
              `Estimator` constructor.
            `config`: Optional configuration object, same value passed in the
              `Estimator` constructor.
          * Returns: A Tensor of shape [batch_size, group_size] that contains a
            score for each example, or a `dict` of Tensors with the above shape in
            multi-task setting.
        group_size: An integer denoting the number of examples in
          `group_score_fn`.
        transform_fn: See `_RankingModel`.
  
      Raises:
        ValueError: when group_size is invalid.
      """
      super(_GroupwiseRankingModel, self).__init__(transform_fn)
      if group_size <= 0:
          raise ValueError("Invalid group_size %d" % group_size)
      self._group_size = group_size
      self._score_fn = group_score_fn
  
      # Internal variables.
      self._feature_gather_indices = None
      self._score_scatter_indices = None
      self._indices_mask = None
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import abc
  import six
  import tensorflow
  from tensorflow import estimator
  from tensorflow.python.util import function_utils
  from tensorflow_ranking.python import feature
  from tensorflow_ranking.python import utils
label_desc: Use image node_id 1 to create a new _GroupwiseRankingModel object from inherited base classes: _RankingModel with example: obj = _GroupwiseRankingModel(group_score_fn, group_size, transform_fn)