class_docstr: NMT re-ranking.
  
  Args:
     alpha (float): Length parameter.
     beta (float):  Coverage parameter.
     length_penalty (str): Length penalty strategy.
     coverage_penalty (str): Coverage penalty strategy.
  
  Attributes:
      alpha (float): See above.
      beta (float): See above.
      length_penalty (callable): See :class:`penalties.PenaltyBuilder`.
      coverage_penalty (callable): See :class:`penalties.PenaltyBuilder`.
      has_cov_pen (bool): See :class:`penalties.PenaltyBuilder`.
      has_len_pen (bool): See :class:`penalties.PenaltyBuilder`.
class_docstr_tok: ["NMT","re-ranking",".","Args",":","alpha","(","float",")",":","Length","parameter",".","beta","(","float",")",":","Coverage","parameter",".","length_penalty","(","str",")",":","Length","penalty","strategy",".","coverage_penalty","(","str",")",":","Coverage","penalty","strategy",".","Attributes",":","alpha","(","float",")",":","See","above",".","beta","(","float",")",":","See","above",".","length_penalty","(","callable",")",":","See",":","class",":","`","penalties.PenaltyBuilder","`",".","coverage_penalty","(","callable",")",":","See",":","class",":","`","penalties.PenaltyBuilder","`",".","has_cov_pen","(","bool",")",":","See",":","class",":","`","penalties.PenaltyBuilder","`",".","has_len_pen","(","bool",")",":","See",":","class",":","`","penalties.PenaltyBuilder","`","."]
code: def _validate(cls, alpha, beta, length_penalty, coverage_penalty):
      # these warnings indicate that either the alpha/beta
      # forces a penalty to be a no-op, or a penalty is a no-op but
      # the alpha/beta would suggest otherwise.
      if length_penalty is not None and alpha == 0.0:
          warnings.warn(
              "Using length penalty with alpha==0 "
              "is equivalent to using length penalty none."
          )
      if coverage_penalty is None or coverage_penalty == "none":
          if beta != 0:
              warnings.warn(
                  "Non-default `beta` with no coverage penalty. "
                  "`beta` has no effect."
              )
      else:
          # using some coverage penalty
          if beta == 0.0:
              warnings.warn(
                  "Non-default coverage penalty with beta==0 "
                  "is equivalent to using coverage penalty none."
              )
  
imports: import torch
  from onmt.translate import penalties
  from onmt.translate.decode_strategy import DecodeStrategy
  import warnings
label_desc: Use image node_id 3 for calling the GNMTGlobalScorer obj's underlying member method code with example usage: obj._validate(cls, alpha, beta, length_penalty, coverage_penalty) without return types