You have to multiply the given grad_output with the gradient of that op to get the grad_input. This is basically one application of the chain rule.
Make sure to use the gradcheck as mentioned in the doc above to make sure your gradient formula is correct.