def METHOD_NAME(cls, ctx, op: "TensorMapChunk"):
    in_data = ctx[op.inputs[0].key]
    out_chunk = op.outputs[0]
    args = op.args or tuple()
    kwargs = op.kwargs or dict()
    if op.with_chunk_index:
        kwargs["chunk_index"] = out_chunk.index
    chunks = find_objects(args, CHUNK_TYPE) + find_objects(kwargs, CHUNK_TYPE)
    mapping = {chunk: ctx[chunk.key] for chunk in chunks}
    args = replace_objects(args, mapping)
    kwargs = replace_objects(kwargs, mapping)
    ctx[op.outputs[0].key] = op.func(in_data, *args, **kwargs)