Skip to content

Commit

Permalink
Fix to avoid fail when only import paddle
Browse files Browse the repository at this point in the history
  • Loading branch information
0xzhang committed Apr 29, 2022
1 parent d7cc03c commit 9662f48
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion python/taichi/lang/kernel_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,8 @@ def func__(*args):
ndarray_type.NdarrayType) and (self.match_ext_arr(v)):
has_external_arrays = True
is_numpy = isinstance(v, np.ndarray)
is_torch = isinstance(v, torch.Tensor)
is_torch = isinstance(v,
torch.Tensor) if has_torch else False
if is_numpy:
tmp = np.ascontiguousarray(v)
# Purpose: DO NOT GC |tmp|!
Expand Down

0 comments on commit 9662f48

Please sign in to comment.