Skip to content

Commit 6a39bcb

Browse files
committed
Clear warning message from torch
1 parent 231a977 commit 6a39bcb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pytensor/link/pytorch/dispatch/basic.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,10 @@ def arange(start, stop, step):
123123
def pytorch_funcify_Join(op, **kwargs):
124124
def join(axis, *tensors):
125125
# tensors could also be tuples, and in this case they don't have a ndim
126-
tensors = [torch.tensor(tensor) for tensor in tensors]
126+
tensors = [
127+
torch.tensor(tensor) if not torch.is_tensor(tensor) else tensor
128+
for tensor in tensors
129+
]
127130

128131
return torch.cat(tensors, dim=axis)
129132

0 commit comments

Comments
 (0)