Commit 8bdc40f
committed
tensor: permuting axpy_to initializes an empty target
Tensor::axpy_to(arg, factor, perm) went straight to inplace_binary,
which asserts the target is non-empty. The first contribution into an
unallocated tensor -- e.g. a tensor-of-tensors contraction result inner
cell, when the inner op carries a permutation -- therefore aborted at
kernels.h:395. Mirror the non-permuting axpy_to overload: when the
target is empty, initialize it to factor * (perm ^ arg).
Fixes the einsum_manual/different_nested_ranks "ik;mn,j->ijk;nm" case
(mixed-nested-rank outer product with an inner-mode permutation) and
drops its TODO(tot-einsum-empty-result) breadcrumb.1 parent 6e6e8ef commit 8bdc40f
2 files changed
Lines changed: 9 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2243 | 2243 | | |
2244 | 2244 | | |
2245 | 2245 | | |
| 2246 | + | |
| 2247 | + | |
| 2248 | + | |
| 2249 | + | |
| 2250 | + | |
| 2251 | + | |
| 2252 | + | |
| 2253 | + | |
| 2254 | + | |
2246 | 2255 | | |
2247 | 2256 | | |
2248 | 2257 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
284 | 284 | | |
285 | 285 | | |
286 | 286 | | |
287 | | - | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | 287 | | |
293 | 288 | | |
294 | 289 | | |
| |||
0 commit comments