Commit d42a7a7
authored
[tmva][sofie] Fix double-counted dilation in Conv im2col
Conv generated invalid code and crashed (segfault) for dilation > 1. The operator builds a dilated `_f` weight buffer and expands `fAttrKernelShape` to the effective kernel size, but the im2col call was still passed the real dilation, so dilation was applied twice (expanded kernel + dilation). This produced a negative output dimension and an out-of-bounds write.
Fix: after the dilated `_f` is built, the dense im2col must use dilation 1, since the dilation is already folded into the expanded kernel shape and the `_f` layout. This is a no-op for dilation 1, so existing Conv tests are unaffected.
Also adds a `ConvWithDilation` test (3x3 kernel, dilation 2) with reference output. The suite had no dilation > 1 case before, which is why this was never caught. The full SOFIE test suite passes locally on master.1 parent af14fa6 commit d42a7a7
4 files changed
Lines changed: 29 additions & 0 deletions
File tree
- tmva/sofie
- inc/TMVA
- test
- input_models
- references
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
429 | 429 | | |
430 | 430 | | |
431 | 431 | | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
432 | 436 | | |
433 | 437 | | |
434 | 438 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
726 | 727 | | |
727 | 728 | | |
728 | 729 | | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
729 | 751 | | |
730 | 752 | | |
731 | 753 | | |
| |||
Binary file not shown.
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
0 commit comments