def broadcast_gradient_args(x, y):
    """
    Return the reduction indices for computing gradients of x op y with broadcast.

    Args:
        x (Union[list, tuple]): the shape of data input
        y (Union[list, tuple]): the shape of data input

    Returns:
        rx (list): the reduction indices for computing gradients of x
        ry (list): the reduction indices for computing gradients of y
    """
    rx = []
    ry = []
    for i, item in enumerate(x):
        if item < y[i]:
            rx.append(i)
        elif item > y[i]:
            ry.append(i)

    return rx, ry