Skip to content

Commit

Permalink
Smarter linker
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian Schweer committed Oct 27, 2024
1 parent 8b8e174 commit 494bcc5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pytensor/link/pytorch/linker.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ def input_filter(self, inp: Any) -> Any:
return pytorch_typify(inp)

def output_filter(self, var: Variable, out: Any) -> Any:
return out.cpu()
import torch

if torch.is_tensor(out):
return out.cpu()
return out

def fgraph_convert(self, fgraph, input_storage, storage_map, **kwargs):
from pytensor.link.pytorch.dispatch import pytorch_funcify
Expand Down

0 comments on commit 494bcc5

Please sign in to comment.