[LTC] Code-gen `sort` (#67053)
- Code-gen `sort`.
- Teach `gen_lazy_nativefunc_definition` to emit assertions that the
number of shapes/dtypes computed is as expected.
- Fix bug in `smooth_l1_loss_backward` uncovered by the assertion.
Test Plan:
```
test/cpp/build/test_ptltc
```