"...text-generation-inference.git" did not exist on "2b53d71991e8fe975be41a82ffe3b52b0bcd40a3"
Commit 813352e1 authored by Myle Ott's avatar Myle Ott
Browse files

Don't save/restore convolutional layers in incremental inference

parent cb0d7b2a
...@@ -284,9 +284,8 @@ class Decoder(nn.Module): ...@@ -284,9 +284,8 @@ class Decoder(nn.Module):
'already performing incremental inference' 'already performing incremental inference'
self._is_inference_incremental = True self._is_inference_incremental = True
# save original forward and convolution layers # save original forward
self._orig_forward = self.forward self._orig_forward = self.forward
self._orig_conv = self.convolutions
# switch to incremental forward # switch to incremental forward
self.forward = self._incremental_forward self.forward = self._incremental_forward
...@@ -295,9 +294,8 @@ class Decoder(nn.Module): ...@@ -295,9 +294,8 @@ class Decoder(nn.Module):
self.start_fresh_sequence(beam_size) self.start_fresh_sequence(beam_size)
def _stop_incremental_inference(self): def _stop_incremental_inference(self):
# restore original forward and convolution layers # restore original forward
self.forward = self._orig_forward self.forward = self._orig_forward
self.convolutions = self._orig_conv
self._is_inference_incremental = False self._is_inference_incremental = False
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment