Open Slimakanzer opened 2 years ago
The output alias is correct for slice at it will alias its input buffer. It doesn't make a copy. We could consider inserting copies when the output buffers dont match the return shapes.
Hi @Slimakanzer. Is this ticket still relevant? If not, please close the ticket. Thanks!
The program fails with an error if the last op is slice.
```cpp #includeCode example
Local configuration
Root cause
instruction.cpp:get_output_alias returns the input tensor as the slice op defines the next output alias:
https://github.com/ROCmSoftwarePlatform/AMDMIGraphX/blob/c99be32c013a21c41f6ad31154fc12c03eac1124/src/include/migraphx/op/slice.hpp#L114
And then replace_allocate.cpp:create_output_names creates incorrect
output_names
with tensor from the previous layer instead of sliced tensor.Solution
I tried the same test program with default
output_alias
for slice operation and it works correctly. I suppose that other operations likereshape
transpose
broadcast
also may throw an error.