def METHOD_NAME(tag_mask, relevant_tag_numbers):
    H, W = tag_mask.shape
    output = np.zeros((H, W), dtype=bool_)
    for i in range(H):
        for j in range(W):
            for n in range(relevant_tag_numbers.size):
                output[i,j] = output[i,j] or (tag_mask[i,j] == relevant_tag_numbers[n])
    return output