Refactor: Removed un-necessary object base class (#32230)
* Refactored to remove un-necessary object base class. * small fix.
This commit is contained in:
@@ -557,7 +557,7 @@ class MultiHeadedAttention(nn.Module):
|
||||
return context
|
||||
|
||||
|
||||
class DecoderState(object):
|
||||
class DecoderState:
|
||||
"""Interface for grouping together the current state of a recurrent
|
||||
decoder. In the simplest case just represents the hidden state of
|
||||
the model. But can also be used for implementing various forms of
|
||||
@@ -694,7 +694,7 @@ def build_predictor(args, tokenizer, symbols, model, logger=None):
|
||||
return translator
|
||||
|
||||
|
||||
class GNMTGlobalScorer(object):
|
||||
class GNMTGlobalScorer:
|
||||
"""
|
||||
NMT re-ranking score from
|
||||
"Google's Neural Machine Translation System" :cite:`wu2016google`
|
||||
@@ -717,7 +717,7 @@ class GNMTGlobalScorer(object):
|
||||
return normalized_probs
|
||||
|
||||
|
||||
class PenaltyBuilder(object):
|
||||
class PenaltyBuilder:
|
||||
"""
|
||||
Returns the Length and Coverage Penalty function for Beam Search.
|
||||
|
||||
@@ -763,7 +763,7 @@ class PenaltyBuilder(object):
|
||||
return logprobs
|
||||
|
||||
|
||||
class Translator(object):
|
||||
class Translator:
|
||||
"""
|
||||
Uses a model to translate a batch of sentences.
|
||||
|
||||
@@ -1002,7 +1002,7 @@ def tile(x, count, dim=0):
|
||||
#
|
||||
|
||||
|
||||
class BertSumOptimizer(object):
|
||||
class BertSumOptimizer:
|
||||
"""Specific optimizer for BertSum.
|
||||
|
||||
As described in [1], the authors fine-tune BertSum for abstractive
|
||||
|
||||
Reference in New Issue
Block a user