Check that operation(*args, out=out) produces results equivalent to out[...] = operation(*args, out=out.copy())
(operation, args, out, **kwargs)
| 577 | |
| 578 | |
| 579 | def assert_copy_equivalent(operation, args, out, **kwargs): |
| 580 | """ |
| 581 | Check that operation(*args, out=out) produces results |
| 582 | equivalent to out[...] = operation(*args, out=out.copy()) |
| 583 | """ |
| 584 | |
| 585 | kwargs['out'] = out |
| 586 | kwargs2 = dict(kwargs) |
| 587 | kwargs2['out'] = out.copy() |
| 588 | |
| 589 | out_orig = out.copy() |
| 590 | out[...] = operation(*args, **kwargs2) |
| 591 | expected = out.copy() |
| 592 | out[...] = out_orig |
| 593 | |
| 594 | got = operation(*args, **kwargs).copy() |
| 595 | |
| 596 | if (got != expected).any(): |
| 597 | assert_equal(got, expected) |
| 598 | |
| 599 | |
| 600 | class TestUFunc: |
no test coverage detected
searching dependent graphs…