Fix small type hinting error (#7820)

* Fix small type hinting error

* Update tokenization_utils_base.py

* Update src/transformers/tokenization_utils_base.py

Co-authored-by: Lysandre Debut <lysandre@huggingface.co>

Co-authored-by: Lysandre Debut <lysandre@huggingface.co>
This commit is contained in:
AndreaSottana 2020-10-19 07:14:29 +01:00 committed by GitHub
parent b86a71ea38
commit 406a49dfe4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -602,7 +602,7 @@ class BatchEncoding(UserDict):
return self return self
@torch_required @torch_required
def to(self, device: str) -> "BatchEncoding": def to(self, device: Union[str, "torch.device"]) -> "BatchEncoding":
""" """
Send all values to device by calling :obj:`v.to(device)` (PyTorch only). Send all values to device by calling :obj:`v.to(device)` (PyTorch only).