[AutoDiff] Clean up `@transposing` attribute type-checking. (#27988)
Remove dead code and unused parameters, unify style.
Fix capacity of `@transposing` attribute parameter indices.
The correct capacity is:
non-wrt parameter count + wrt parameter count - 1.
Todos:
- More clean up; this clean up was not comprehensive.
- Consider revamping type-checking for instance methods so that
`@transposing` functions can always be declared in same type
context as their original declaration.