def _sign(x: TfVal) -> TfVal:
    if x.dtype.is_unsigned:
        return tf.where(tf.math.equal(x, 0), np.array(0, dtype=x.dtype), np.array(1, dtype=x.dtype))
    else:
        return tf.math.sign(x)
def _sign(x: TfVal) -> TfVal:
    if x.dtype.is_unsigned:
        return tf.where(tf.math.equal(x, 0), np.array(0, dtype=x.dtype), np.array(1, dtype=x.dtype))
    else:
        return tf.math.sign(x)