Skip to content

Commit 84a8988

Browse files
committed
Enable torch.is_complex
ghstack-source-id: 14a4125 Pull Request resolved: #103154
1 parent c0ad755 commit 84a8988

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

test/dynamo/test_functions.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,13 @@ def test_get_default_dtype(x):
399399
else:
400400
return x - 1
401401

402+
@make_test
403+
def test_is_complex(x):
404+
if torch.is_complex(x):
405+
return x + 1
406+
else:
407+
return x - 1
408+
402409
@make_test
403410
def test_device(x):
404411
if not x.is_cuda:

torch/_dynamo/variables/torch.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
torch.is_autocast_cache_enabled,
7070
torch.is_autocast_cpu_enabled,
7171
torch.is_autocast_enabled,
72+
torch.is_complex,
7273
torch.is_floating_point,
7374
torch.nn.functional._Reduction.get_enum,
7475
]

0 commit comments

Comments
 (0)