(a, b)
| 370 | |
| 371 | @torch.compile(fullgraph=True) |
| 372 | def bar_fixed(a, b): |
| 373 | x = a / (torch.abs(a) + 1) |
| 374 | |
| 375 | def true_branch(y): |
| 376 | return y * -1 |
| 377 | |
| 378 | def false_branch(y): |
| 379 | # NOTE: torch.cond doesn't allow aliased outputs |
| 380 | return y.clone() |
| 381 | |
| 382 | b = cond(b.sum() < 0, true_branch, false_branch, (b,)) |
| 383 | return x * b |
| 384 | |
| 385 | |
| 386 | bar_fixed(inp1, inp2) |
no outgoing calls
no test coverage detected