Make add parser label work for hidden_depth=0
@@ -800,6 +800,15 @@ cdef class Parser:
if self.model not in (True, False, None) and resized:
# Weights are stored in (nr_out, nr_in) format, so we're basically
# just adding rows here.
+ if self.model[-1].is_noop:
+ smaller = self.model[1]
+ dims = dict(self.model[1]._dims)
+ dims['nO'] = self.moves.n_moves
+ larger = self.model[1].__class__(**dims)
+ copy_array(larger.W[:, :smaller.nO], smaller.W)
+ copy_array(larger.b[:smaller.nO], smaller.b)
+ self.model = (self.model[0], larger, self.model[2])
+ else:
smaller = self.model[-1]._layers[-1]
larger = Affine(self.moves.n_moves, smaller.nI)
copy_array(larger.W[:smaller.nO], smaller.W)
