code: def reshape_range(tensor, i, j, shape):
    
    t_shape = common_layers.shape_list(tensor)
    target_shape = t_shape[:i] + shape + t_shape[j:]
    return tf.reshape(tensor, target_shape)
docs: Reshapes a tensor between dimensions i and j.