Added RequiredGrad attribute to YieldOp (#6657)
* Added required_grad attribute to YieldOp
* Chagened YieldOp attribute to hold the indices of the required gradient outputs from the count, and removed the code reordering the outputs.
* Changed backward_output_grad_names to a map from backward output gradient name to the corresponding output index.