Optimal Input-Dependent Edge-Cloud Partitioning for RNN Inference