Commit 4286c2f
committed
Fix ChannelsLastTaggedReshapePass crash on ops with list-typed args
The `input_to_nhwc` method crashes with `AttributeError: 'immutable_list'
object has no attribute 'graph'` when lowering dynamically quantized models
containing ops like `cat` whose first argument is a list of tensors.
Two fixes:
1. Add `isinstance(args[0], torch.fx.Node)` guard in the dynamic input
trace-back loop to stop when args[0] is not a Node.
2. Handle list-typed `node.args[0]` at the call site by iterating over
each element and converting them individually to NHWC.
Fixes #189441 parent 651f2f2 commit 4286c2f
1 file changed
Lines changed: 12 additions & 3 deletions
Lines changed: 12 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
398 | 398 | | |
399 | 399 | | |
400 | 400 | | |
401 | | - | |
402 | | - | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
403 | 406 | | |
404 | 407 | | |
405 | 408 | | |
| |||
505 | 508 | | |
506 | 509 | | |
507 | 510 | | |
508 | | - | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
509 | 518 | | |
510 | 519 | | |
511 | 520 | | |
| |||
0 commit comments