Commit 34de6fa
authored
fix: Fix mypy TorchTensor type alias error (#6712)
* fix: Fix mypy TorchTensor type alias error
Fix the TypeAlias annotation of TorchTensor in the fallback branch of online_response.py to stop mypy from treating it as a variable and raising 'not valid as a type'.
Fixes #5563
Signed-off-by: Nithin <kumbam.nithingoud@gmail.com>
* fix: remove redundant `import torch` under TYPE_CHECKING block
The bare `import torch` statement inside the `if TYPE_CHECKING:` branch
was superseded by `from torch import Tensor as TorchTensor` on the
following line. Since `TorchTensor` is the only torch symbol referenced
in type annotations, the standalone module import is unnecessary and
can be dropped without affecting runtime or static-analysis behaviour.
Addresses nitpick raised in code review.
Signed-off-by: Nithin <kumbam.nithingoud@gmail.com>
---------
Signed-off-by: Nithin <kumbam.nithingoud@gmail.com>1 parent 037c4cd commit 34de6fa
1 file changed
Lines changed: 3 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | | - | |
30 | | - | |
| 28 | + | |
31 | 29 | | |
32 | | - | |
| 30 | + | |
33 | 31 | | |
34 | 32 | | |
35 | 33 | | |
| |||
0 commit comments