Fix input/output indexing for side broadcast outputs.
Fix input/output indexing for side broadcast outputs.

The current logic is only correct for elementwise ops, but it
is possible to have broadcasts in reduction epilogues.
