Skip to contents

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. A JitPrimitive is accepted and unwrapped to its underlying AnvlPrimitive metadata.

args

(list of GraphNode)
The arguments to the primitive.

params

(list)
The parameters to the primitive.

infer_fn

(function)
The inference function to use. Must output a list of AbstractArrays.

desc

(GraphDescriptor | NULL)
The graph descriptor to add the primitive call to. Uses the current descriptor if NULL.

Value

(list of GraphBox)