Commit 5d80f41
Wei Wei
[fx2trt] improve pad/permute/setitem/getitem op (#72)
Summary:
Pull Request resolved: https://github.com/pytorch/fx2trt/pull/72
1. support value in pad op
2. permute op improvement since it could not handle x.permute(permutation)
3. improve setitem:
1) fix issue with slice(-n,None,None)
4. improve getitem:
1) support x[slice(None,None,None), slice(0,0,None)]
This case is needed for setitem pass optimization. When we need to split a range where the dimension is (20,10)
(slice(None,None,None), slice(-10,None,None)) -->
(slice(None,None,None), slice(0,-10,None)) + (slice(None,None,None), slice(-10,None,None))
Reviewed By: yinghai
Differential Revision: D36223023
fbshipit-source-id: 7d87c74b85b5c6c6efcd46dac209a46af208d3f91 parent d418a37 commit 5d80f41
File tree
5 files changed
+75
-23
lines changed- fx
- converters
- passes
- test/converters/acc_op
5 files changed
+75
-23
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
332 | 332 | | |
333 | 333 | | |
334 | 334 | | |
335 | | - | |
336 | | - | |
337 | | - | |
338 | | - | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
339 | 341 | | |
340 | 342 | | |
341 | 343 | | |
| |||
352 | 354 | | |
353 | 355 | | |
354 | 356 | | |
| 357 | + | |
355 | 358 | | |
356 | 359 | | |
357 | 360 | | |
| |||
360 | 363 | | |
361 | 364 | | |
362 | 365 | | |
| 366 | + | |
363 | 367 | | |
364 | 368 | | |
365 | 369 | | |
| |||
373 | 377 | | |
374 | 378 | | |
375 | 379 | | |
| 380 | + | |
376 | 381 | | |
377 | 382 | | |
378 | 383 | | |
| |||
2776 | 2781 | | |
2777 | 2782 | | |
2778 | 2783 | | |
2779 | | - | |
2780 | | - | |
2781 | | - | |
| 2784 | + | |
| 2785 | + | |
| 2786 | + | |
| 2787 | + | |
| 2788 | + | |
| 2789 | + | |
| 2790 | + | |
| 2791 | + | |
| 2792 | + | |
2782 | 2793 | | |
2783 | 2794 | | |
2784 | 2795 | | |
| |||
2989 | 3000 | | |
2990 | 3001 | | |
2991 | 3002 | | |
2992 | | - | |
2993 | | - | |
2994 | | - | |
| 3003 | + | |
| 3004 | + | |
| 3005 | + | |
| 3006 | + | |
| 3007 | + | |
2995 | 3008 | | |
2996 | 3009 | | |
2997 | 3010 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | 3 | | |
5 | 4 | | |
6 | 5 | | |
| |||
297 | 296 | | |
298 | 297 | | |
299 | 298 | | |
300 | | - | |
| 299 | + | |
301 | 300 | | |
302 | 301 | | |
303 | 302 | | |
| |||
364 | 363 | | |
365 | 364 | | |
366 | 365 | | |
367 | | - | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
368 | 371 | | |
369 | 372 | | |
370 | 373 | | |
| |||
375 | 378 | | |
376 | 379 | | |
377 | 380 | | |
378 | | - | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
379 | 393 | | |
380 | 394 | | |
381 | 395 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
40 | 44 | | |
41 | 45 | | |
42 | 46 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | | - | |
| 15 | + | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
29 | 31 | | |
30 | 32 | | |
31 | 33 | | |
32 | 34 | | |
33 | | - | |
| 35 | + | |
| 36 | + | |
34 | 37 | | |
35 | 38 | | |
36 | | - | |
| 39 | + | |
37 | 40 | | |
38 | 41 | | |
39 | | - | |
| 42 | + | |
40 | 43 | | |
41 | 44 | | |
42 | | - | |
| 45 | + | |
43 | 46 | | |
44 | 47 | | |
45 | | - | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
46 | 51 | | |
47 | 52 | | |
48 | 53 | | |
| |||
64 | 69 | | |
65 | 70 | | |
66 | 71 | | |
| 72 | + | |
| 73 | + | |
67 | 74 | | |
68 | 75 | | |
69 | 76 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
10 | 24 | | |
11 | 25 | | |
12 | 26 | | |
| |||
0 commit comments