We're trying to implement a piecewise function, basically around 100 polynomials with different coefficients depending on the value of x.
This will be implemented in TensorFlow or jax with JIT and be optimized for arrays of data. The question is what is probably the best way to achieve this?
One could use one-hundred wheres, but that is not really optimal. Or use the tf.switch_case with tf.vectorize_map (or similar).
Are there any ideas?
