[SOLVED] Conditional Relay Operator

Hi, I am working on implementing the TFLite rounding in TVM/Relay for quantization.

I have a very specific usecase.

final_const_scalar = (my_relay_expr < 0) ? const_scalar_1 : const_scalar_2;

Is there any Relay operator that hides this if condition inside the topi? (Don’t want to complicate by bringing the if condition at the Relay graph level yet).

@zhiics @FrozenGene @tqchen @yzhliu

https://docs.tvm.ai/langref/relay_op.html#tvm.relay.where

1 Like

Thanks so much. You are awesome :slight_smile: