Reverse a tensor along dim using slice with step=-1.
(in_slot, out_slot)
| 4081 | return slice_tmp |
| 4082 | |
| 4083 | def emit_reverse(in_slot, out_slot): |
| 4084 | """Reverse a tensor along dim using slice with step=-1.""" |
| 4085 | P.emit( |
| 4086 | SliceNode( |
| 4087 | x=P.slot_to_tid(in_slot), |
| 4088 | out=P.slot_to_tid(out_slot), |
| 4089 | axis=P.to_int_or_vid(dim), |
| 4090 | start=rev_start, |
| 4091 | stop=rev_stop, |
| 4092 | step=-1, |
| 4093 | ) |
| 4094 | ) |
| 4095 | |
| 4096 | if 0 in used: |
| 4097 | # partition → slice last k → sort ascending → reverse to descending |
no test coverage detected