mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-07 12:21:27 +01:00
Support unary not on lists (#102210)
Fixes #ISSUE_NUMBER Pull Request resolved: https://github.com/pytorch/pytorch/pull/102210 Approved by: https://github.com/anijain2305
This commit is contained in:
parent
a0e44284de
commit
2434a205de
|
|
@ -807,6 +807,10 @@ class FunctionTests(torch._dynamo.test_case.TestCase):
|
|||
tmp.append(a + b)
|
||||
return tmp
|
||||
|
||||
@make_test
|
||||
def test_not_list(a):
|
||||
return not [a + 1]
|
||||
|
||||
@make_test
|
||||
def test_islice_chain(a, b):
|
||||
tmp1 = [a + 1, a + 2]
|
||||
|
|
|
|||
|
|
@ -1314,6 +1314,10 @@ class BuiltinVariable(VariableTracker):
|
|||
),
|
||||
sym_num=None,
|
||||
)
|
||||
|
||||
if isinstance(a, ListVariable):
|
||||
return ConstantVariable(len(a.items) == 0).add_options(self, a)
|
||||
|
||||
return None
|
||||
|
||||
call_eq = _comparison
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user