From 406a49dfe4a7bced24cd63b5875f3192c72598dd Mon Sep 17 00:00:00 2001 From: AndreaSottana <48888970+AndreaSottana@users.noreply.github.com> Date: Mon, 19 Oct 2020 07:14:29 +0100 Subject: [PATCH] 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 Co-authored-by: Lysandre Debut --- src/transformers/tokenization_utils_base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/transformers/tokenization_utils_base.py b/src/transformers/tokenization_utils_base.py index b2c1797b5e..a79dbb8fbf 100644 --- a/src/transformers/tokenization_utils_base.py +++ b/src/transformers/tokenization_utils_base.py @@ -602,7 +602,7 @@ class BatchEncoding(UserDict): return self @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).