Commit d77461d
authored
* Surface ConvTranspose padding=0+output_padding ValueError instead of TypeError
The torch conv code normalizes the all-zero `pad` to `None` (the conv
builder treats `None` as the all-zero default). When a ConvTranspose
also has `output_padding > 0` -- which happens implicitly when the
user calls `convt(x, output_size=...)` and the implied stride/kernel
math demands extra output -- `_construct_conv_transpose` then tries
`sum(pad)`, `pad.copy()`, and `pad *= 0` on that `None`, blowing up
with:
TypeError: 'NoneType' object is not iterable
The existing code path already documents this combination as
unsupported and raises a clear `ValueError` for it, but only when
`pad` is an array. Re-materialize the implicit zeros so the documented
ValueError fires instead of the cryptic TypeError; users with the
unsupported configuration now get an actionable message.
Adds `TestConvTranspose::test_convtranspose1d_padding_zero_output_padding_clear_error`
covering exactly the issue repro (Conv1d + ConvTranspose1d with
padding=0 and `output_size=(1024,)`). Runs without BlobWriter.
Fixes #2377
* Address review: trim verbose comment in _construct_conv_transpose
1 parent dc0c41c commit d77461d
2 files changed
Lines changed: 40 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1379 | 1379 | | |
1380 | 1380 | | |
1381 | 1381 | | |
| 1382 | + | |
| 1383 | + | |
| 1384 | + | |
1382 | 1385 | | |
1383 | 1386 | | |
1384 | 1387 | | |
| |||
Lines changed: 37 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2290 | 2290 | | |
2291 | 2291 | | |
2292 | 2292 | | |
| 2293 | + | |
| 2294 | + | |
| 2295 | + | |
| 2296 | + | |
| 2297 | + | |
| 2298 | + | |
| 2299 | + | |
| 2300 | + | |
| 2301 | + | |
| 2302 | + | |
| 2303 | + | |
| 2304 | + | |
| 2305 | + | |
| 2306 | + | |
| 2307 | + | |
| 2308 | + | |
| 2309 | + | |
| 2310 | + | |
| 2311 | + | |
| 2312 | + | |
| 2313 | + | |
| 2314 | + | |
| 2315 | + | |
| 2316 | + | |
| 2317 | + | |
| 2318 | + | |
| 2319 | + | |
| 2320 | + | |
| 2321 | + | |
| 2322 | + | |
| 2323 | + | |
| 2324 | + | |
| 2325 | + | |
| 2326 | + | |
| 2327 | + | |
| 2328 | + | |
| 2329 | + | |
2293 | 2330 | | |
2294 | 2331 | | |
2295 | 2332 | | |
| |||
0 commit comments