Make ParserModel.resize_output idempotent

This commit is contained in:
Matthew Honnibal 2018-12-19 02:10:36 +01:00
parent 9fc8ce0c4d
commit 99a84e4d0e

View File

@ -201,6 +201,8 @@ class ParserModel(Model):
return step_model, finish_parser_update
def resize_output(self, new_output):
if new_output == self.upper.nO:
return
smaller = self.upper
larger = Affine(new_output, smaller.nI)
larger.W *= 0