Commit e22d0f5
[Torchaudio] allow masked_value to be tensor (pytorch#4015)
Summary:
Pull Request resolved: pytorch#4015
Add support for mask_value to be tensor: for example, if we want to fill with mean values of featured.
when mask_value is tensor masked_fill creates additional D2D copy, rewriting with torch.where to avoid it
Differential Revision: D794516151 parent 0c22347 commit e22d0f5
File tree
3 files changed
+20
-3
lines changed- src/torchaudio
- functional
- transforms
- test/torchaudio_unittest/functional
3 files changed
+20
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
817 | 817 | | |
818 | 818 | | |
819 | 819 | | |
820 | | - | |
| 820 | + | |
821 | 821 | | |
822 | 822 | | |
823 | 823 | | |
| |||
874 | 874 | | |
875 | 875 | | |
876 | 876 | | |
877 | | - | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
878 | 883 | | |
879 | 884 | | |
880 | 885 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1185 | 1185 | | |
1186 | 1186 | | |
1187 | 1187 | | |
1188 | | - | |
| 1188 | + | |
1189 | 1189 | | |
1190 | 1190 | | |
1191 | 1191 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
456 | 456 | | |
457 | 457 | | |
458 | 458 | | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
459 | 471 | | |
460 | 472 | | |
461 | 473 | | |
| |||
0 commit comments