Skip to content

Commit

Permalink
pylint and flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
hector.liu committed Dec 6, 2020
1 parent 6e1f622 commit ec45dda
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions examples/content_rewriter/model/copy_net.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def with_same_shape(old, new):
return nest.map_structure(
with_same_shape,
self,
super(CopyNetWrapperState, self)._replace(**kwargs))
super()._replace(**kwargs))


class CopyNetWrapper(tf.nn.rnn_cell.RNNCell):
Expand All @@ -47,7 +47,7 @@ def __init__(
coverity_dim=None, coverity_rnn_cell_hparams=None,
disabled_vocab_size=0, eps=0.,
reuse=tf.AUTO_REUSE, name=None):
super(CopyNetWrapper, self).__init__(name=name)
super().__init__(name=name)

with tf.variable_scope("CopyNetWrapper", reuse=reuse):
self._cell = cell
Expand Down
4 changes: 2 additions & 2 deletions examples/wiki_parser/wiki_dump_parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def __init__(self):
self.article_count: int = 0

def initialize(self, resources: Resources, configs: Config):
super(WikiArticleWriter, self).initialize(resources, configs)
super().initialize(resources, configs)
self.article_count = 0
self.article_index = open(
os.path.join(self.configs.output_dir, 'article.idx'), 'w')
Expand All @@ -77,7 +77,7 @@ def _process(self, input_pack: DataPack):
Returns:
"""
super(WikiArticleWriter, self)._process(input_pack)
super()._process(input_pack)

out_path = self.sub_output_path(input_pack)
if self.zip_pack:
Expand Down
2 changes: 1 addition & 1 deletion forte/models/srl/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def __init__(self, word_vocab: tx.data.Vocab, char_vocab: tx.data.Vocab,
num_output_representations=1)
self._elmo_char_ids_fn = batch_to_ids
else:
self.elmo = None # type: ignore
self.elmo = None # type: ignore

# LSTM
single_hidden_dim = self._hparams.contextualization_size
Expand Down

0 comments on commit ec45dda

Please sign in to comment.