Skip to content

Minor issue in the CompiledFunction call interface #1972

@dime10

Description

@dime10

Happened upon this by chance, but it appears to me the following line is erroneous:

args is defined up here and always consists of two elements, the args tuple and the kwargs dict:

args_data, args_shape = tree_flatten((args, kwargs))
for arg in args_data:
numpy_arg = np.asarray(arg)
numpy_arg_buffer.append(numpy_arg)
c_abi_ptr = ctypes.pointer(get_ranked_memref_descriptor(numpy_arg))
c_abi_args.append(c_abi_ptr)
args = tree_unflatten(args_shape, c_abi_args)

My guess is maybe the author intended to check the length of args_data, but I'm not 100% sure. Apparently this mistake doesn't cause any issues (except when I was messing around with the CompiledFunction internals directly).

Metadata

Metadata

Assignees

No one assigned

    Labels

    frontendPull requests that update the frontend

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions