We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 977d98d commit 07e4520Copy full SHA for 07e4520
pytensor/link/pytorch/linker.py
@@ -1,8 +1,6 @@
1
import copy
2
from typing import Any
3
4
-from torch import is_tensor
5
-
6
from pytensor.graph.basic import Variable
7
from pytensor.link.basic import JITLinker
8
from pytensor.link.utils import unique_name_generator
@@ -21,6 +19,8 @@ def input_filter(self, inp: Any) -> Any:
21
19
return pytorch_typify(inp)
22
20
23
def output_filter(self, var: Variable, out: Any) -> Any:
+ from torch import is_tensor
+
24
if is_tensor(out):
25
return out.cpu()
26
else:
0 commit comments