def METHOD_NAME(cls, ctx, op):
    inputs, device_id, xp = as_same_device(
        [ctx[c.key] for c in op.inputs], device=op.device, ret_extra=True
    )
    inputs_iter = iter(inputs)
    a = next(inputs_iter)
    a_min = (
        next(inputs_iter) if isinstance(op.a_min, type(op.outputs[0])) else op.a_min
    )
    a_max = (
        next(inputs_iter) if isinstance(op.a_max, type(op.outputs[0])) else op.a_max
    )
    out = next(inputs_iter).copy() if op.out is not None else None
    with device(device_id):
        kw = {}
        if out is not None:
            kw["out"] = out
        ctx[op.outputs[0].key] = xp.clip(a, a_min, a_max, **kw)