case
API属性:声明式编程(静态图)专用API
该OP的运行方式类似于python的if-elif-elif-else。
Variable|list(Variable)
TypeError
- 如果pred_fn_pairs
的类型不是list或tuple。- - 如果
pred_fn_pairs
的tuple类型的元素大小不是2。TypeError
- 如果pred_fn_pairs
中的2-tuple的第一个元素的类型不是Variable。TypeError
- 如果pred_fn_pairs
中的2-tuple的第二个元素不是可调用对象。TypeError
- 当 不是None又不是可调用对象时。