def _clamp(minval, operand, maxval, *, _in_avals, _out_aval):
    op_shape_tf_val = _eval_shape(_in_avals[1].shape)
    maxval = tf.broadcast_to(maxval, op_shape_tf_val)
    minval = tf.math.minimum(tf.broadcast_to(minval, op_shape_tf_val), maxval)
    return tf.clip_by_value(operand, minval, maxval)
def _clamp(minval, operand, maxval, *, _in_avals, _out_aval):
    op_shape_tf_val = _eval_shape(_in_avals[1].shape)
    maxval = tf.broadcast_to(maxval, op_shape_tf_val)
    minval = tf.math.minimum(tf.broadcast_to(minval, op_shape_tf_val), maxval)
    return tf.clip_by_value(operand, minval, maxval)