inducer / arraycontext

Choose your favorite numpy-workalike!
6 stars 11 forks source link

Exposing `np.select`? #202

Open kaushikcfd opened 2 years ago

kaushikcfd commented 2 years ago

Should we support np.select? It's a bit controversial because one could chain np.where to emulate np.select, but I thought this would be a cleaner way to implement https://github.com/inducer/meshmode/issues/355.

inducer commented 2 years ago

I think a canned implementation in terms of wheres makes sense, though perhaps not with pressing urgency. The main reason to me would be that select could boil down to $\log(n)$ actually executed ternaries as opposed to $n$.