Fix type annotation error. (#15448)
authorEdward Yang <ezyang@fb.com>
Thu, 20 Dec 2018 22:26:23 +0000 (14:26 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Thu, 20 Dec 2018 22:47:57 +0000 (14:47 -0800)
Summary:
According to mypy, the trailing -> None is mandatory.

Signed-off-by: Edward Z. Yang <ezyang@fb.com>
Pull Request resolved: https://github.com/pytorch/pytorch/pull/15448

Differential Revision: D13532179

Pulled By: ezyang

fbshipit-source-id: e8972f8c9ada4657c518cd7bcd46e489ab8ddf5f

torch/nn/modules/rnn.py

index 89d9b94..3db8ebf 100644 (file)
@@ -570,7 +570,7 @@ class RNNCellBase(Module):
 
     @weak_script_method
     def check_forward_hidden(self, input, hx, hidden_label=''):
-        # type: (Tensor, Tensor, str)
+        # type: (Tensor, Tensor, str) -> None
         if input.size(0) != hx.size(0):
             raise RuntimeError(
                 "Input batch size {} doesn't match hidden{} batch size {}".format(