"""Computes the gradients for reduce_sum.
Args:
op: The reduce_sum Operation that we are differentiating
grad: Gradient with respect to the output of the reduce_sum op.
Returns:
Gradients with respect to the input of reduce_sum.
"""
A = op.inputs[0]
output_shape = np.array(A.shape)
output_shape[op.axis] = 1
tile_scaling = A.shape // output_shape