def METHOD_NAME(cls, ctx, op):
    chunk = op.outputs[0]
    inputs = as_same_device([ctx[c.key] for c in op.inputs], device=op.device)
    counter = count()
    # Unified the var names to V_0, V_1, ... for better cache hit.
    key_to_var = defaultdict(lambda: f"V_{counter.__next__()}")
    local_dict = {key_to_var[c.key]: i for c, i in zip(op.inputs, inputs)}
    expr = _evaluate(chunk).format_map(key_to_var)
    # The numexpr.evaluate is thread safe: https://github.com/pydata/numexpr/pull/200
    try:
        res = ne.evaluate(expr, local_dict=local_dict, global_dict={})
    except Exception as e:
        raise RuntimeError(
            f"Failed to evaluate numexpr {repr(expr)} on local dict {local_dict}."
        ) from e
    res = _maybe_keepdims(chunk, res)
    if chunk.ndim == 0 and res.ndim == 1 and res.size == 0:
        res = res.dtype.type(0)
    ctx[chunk.key] = res