pytorch/torch/_dynamo/variables
ydwu4 3062e267b1 [cond] Add more tests for valid inputs of cond (#110727)
This PR adds a parametrized test for cond. It tests cond can be traced with valid inputs. Specifically valid inputs is combination of:
- pred (python boolean, boolean tensor, int tensor, scalar tensor)
- true_fn/false_fn (func, obj, nn_module)
- Operands (0 or more tensor inputs), tested with 0  and 2
- closures (0 or more tensor closures), tested with 0 and 2
- nested_level (no nesting or level-2 nested cond)

What this test doesn't cover:
- pred: symbolic boolean expression as predicate
- true_fn/false_fn: that mutates indermediate tensors
- operands: non-tensor operands such as float, int
- closures: nn_module attribute closures, python constant closures
- nested_level: 3+

Pull Request resolved: https://github.com/pytorch/pytorch/pull/110727
Approved by: https://github.com/zou3519
2023-10-11 15:56:13 +00:00
..
__init__.py Support inference_mode decorator (#109274) 2023-09-27 22:21:42 +00:00
base.py [Easy] ConstantVariable() -> .create (#109896) 2023-09-22 22:30:15 +00:00
builder.py Make NestedTensor compilable with eager backend (#109171) 2023-10-11 04:47:10 +00:00
builtin.py Revert "[user errors] compulsory case names, allow multiple (#110878)" 2023-10-10 04:44:40 +00:00
constant.py Revert "[user errors] compulsory case names, allow multiple (#110878)" 2023-10-10 04:44:40 +00:00
ctx_manager.py Support inference_mode decorator (#109274) 2023-09-27 22:21:42 +00:00
dicts.py [dynamo] [easy]Remove InstructionTranslator from within Set (#110521) 2023-10-05 04:01:18 +00:00
distributed.py [Easy] ConstantVariable() -> .create (#109896) 2023-09-22 22:30:15 +00:00
functions.py Support a simple subset of functions as backward hooks on intermediate tensors (#109537) 2023-10-11 01:35:37 +00:00
higher_order_ops.py [cond] Add more tests for valid inputs of cond (#110727) 2023-10-11 15:56:13 +00:00
lists.py [dynamo] list index: add more list types to testing, support namedtuple, improve error handling (#110919) 2023-10-11 00:16:39 +00:00
misc.py [dynamo] Add itertools.repeat via polyfill (#110953) 2023-10-10 20:40:33 +00:00
nn_module.py [Easy] ConstantVariable() -> .create (#109896) 2023-09-22 22:30:15 +00:00
optimizer.py Fix typo under torch/_dynamo directory (#110459) 2023-10-04 16:05:05 +00:00
tensor.py Support a simple subset of functions as backward hooks on intermediate tensors (#109537) 2023-10-11 01:35:37 +00:00
torch.py Fix typo under torch/_dynamo directory (#110459) 2023-10-04 16:05:05 +00:00
user_defined.py Support inference_mode decorator (#109274) 2023-09-27 22:21:42 +00:00