I have a small test case that gives me unexpected output.
data = relay.var("data", shape=(1, 5), dtype="float32") # --> [63, -4, 76, 0, 60000]
func = relay.op.clip(data, a_min=-32768, a_max=32767) # --> [63, -4, 76, 0, 32767]
func = relay.op.cast(func, dtype="int16") # --> [63, -4, 76, 0, 32767]
func = relay.op.clip(func, a_min=0, a_max=65535) # --> [0, 0, 0, 0, 0]
At the end of each line, I am showing the intermediate output. Can somebody help me explain the result of the last line?