Refactor: Removed un-necessary object base class (#32230)

* Refactored to remove un-necessary object base class.

* small fix.
This commit is contained in:
Sai-Suraj-27
2024-07-26 14:03:02 +05:30
committed by GitHub
parent 1c7ebf1d6e
commit b8e5cd5396
56 changed files with 89 additions and 89 deletions

View File

@@ -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