legate.core.task.VariantInvoker.prepare_call#

VariantInvoker.prepare_call(
self,
AutoTask task,
tuple args,
dict kwargs,
ConstraintSet constraints=None,
) void#

Prepare a list of arguments for task call.

Parameters:
  • task (AutoTask) – The task to prepare the arguments for.

  • args (tuple, optional) – The set of positional arguments for the task.

  • kwargs (dict, optional) – The set of keyword arguments for the task.

Raises:
  • ValueError – If multiple arguments are given for a single argument. This may occur, for example, when a keyword argument overlaps with a positional argument.

  • TypeError – If the type of an argument does not match the expected type of the corresponding argument to the task, or if there are missing required parameters.

  • NameError – If a keyword argument does not exist in the function’s signature.

Notes

args and kwargs are not the usual expanded tuple and dict. Instead, they correspond to a literal tuple and dict respectively. That is:

# Incorrect
invoker.prepare_call(
    task,
    a, b, c,
    foo="bar", baz="bop"
)

# Correct
invoker.prepare_call(
    task,
    (a, b, c),
    {"foo" : "bar", "baz" : "bop"}
)