I am trying to define a custom layer in Keras, where the data values are first quantized as -1, 0, or 1. Then, every -1 is transformed to 0. For example, The input tensor is x = [-0.95, -0.85,0.1,0.9]. It will be quantized to x1 = [-1,-1,0,1]. Then, x2 is transformed to x3 = [0,0,0,1]. I have completed the quantization part. However, I don't know how to implement the if-else control flow to map -1 to 0. Thank you for any helpful suggestions.