mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
fix lint (#33861)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/33861 Test Plan: Imported from OSS Differential Revision: D20136865 Pulled By: suo fbshipit-source-id: 4bf7ac324a0abce9b45121ac5ab438448a6f3149
This commit is contained in:
parent
9733711394
commit
f5952cf7cb
|
|
@ -13,7 +13,7 @@ from torch.autograd import Variable
|
||||||
pytorch_test_dir = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
|
pytorch_test_dir = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
|
||||||
sys.path.append(pytorch_test_dir)
|
sys.path.append(pytorch_test_dir)
|
||||||
from torch.testing._internal.jit_utils import JitTestCase
|
from torch.testing._internal.jit_utils import JitTestCase
|
||||||
from torch.testing._internal.common_utils import skipIfNoLapack, suppress_warnings
|
from torch.testing._internal.common_utils import skipIfNoLapack
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
raise RuntimeError("This test file is not meant to be run directly, use:\n\n"
|
raise RuntimeError("This test file is not meant to be run directly, use:\n\n"
|
||||||
|
|
|
||||||
|
|
@ -149,8 +149,12 @@ class PackedSequence(PackedSequence_):
|
||||||
|
|
||||||
# TorchScript doesn't support constructors on named tuples, so we use this helper
|
# TorchScript doesn't support constructors on named tuples, so we use this helper
|
||||||
# method to construct PackedSequence
|
# method to construct PackedSequence
|
||||||
def _packed_sequence_init_args(data, batch_sizes=None, sorted_indices=None, unsorted_indices=None):
|
def _packed_sequence_init_args(data, # type: Tensor
|
||||||
# type: (Tensor, Optional[Tensor], Optional[Tensor], Optional[Tensor]) -> Tuple[Tensor, Tensor, Optional[Tensor], Optional[Tensor]]
|
batch_sizes=None, # type: Optional[Tensor]
|
||||||
|
sorted_indices=None, # type: Optional[Tensor]
|
||||||
|
unsorted_indices=None # type: Optional[Tensor]
|
||||||
|
):
|
||||||
|
# type: (...) -> Tuple[Tensor, Tensor, Optional[Tensor], Optional[Tensor]]
|
||||||
# NB: if unsorted_indices is provided, it should be the inverse permutation
|
# NB: if unsorted_indices is provided, it should be the inverse permutation
|
||||||
# to sorted_indices. Don't assert it here because the PackedSequence ctor
|
# to sorted_indices. Don't assert it here because the PackedSequence ctor
|
||||||
# should only be used internally.
|
# should only be used internally.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user