Add a primitive call to a graph descriptor. Inside a primitive body created
with new_primitive(), pass the lexically-bound self as the primitive
argument.
Usage
graph_desc_add(primitive, args, params = list(), infer_fn, desc = NULL)Arguments
- primitive
(
AnvlPrimitive|JitPrimitive)
The primitive the call is for. AJitPrimitiveis accepted and unwrapped to its underlyingAnvlPrimitivemetadata.- args
(
listofGraphNode)
The arguments to the primitive.- params
(
list)
The parameters to the primitive.- infer_fn
(
function)
The inference function to use. Must output a list ofAbstractArrays.- desc
(
GraphDescriptor|NULL)
The graph descriptor to add the primitive call to. Uses the current descriptor ifNULL.
Value
(list of GraphBox)