- cupy.piecewise(x, condlist, funclist)¶
Evaluate a piecewise-defined function.
x (cupy.ndarray) – input domain
condlist (list of cupy.ndarray) – Each boolean array/ scalar corresponds to a function in funclist. Length of funclist is equal to that of condlist. If one extra function is given, it is used as the default value when the otherwise condition is met
funclist (list of scalars) – list of scalar functions.
- the scalar values in funclist on portions of x
defined by condlist.
- Return type
This function currently doesn’t support callable functions, args and kw parameters.