Skip to contents

Add a primitive call to a graph descriptor.

Usage

graph_desc_add(
  prim,
  args,
  params = list(),
  infer_fn,
  desc = NULL,
  debug_mode = NULL
)

Arguments

prim

(Primitive)
The primitive to add.

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 AbstractTensors.

desc

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

debug_mode

(logical(1))
Whether to just perform abstract evaluation for debugging.

Value

(list of Box)
Either GraphBox objects or DebugBox objects, depending on debug_mode.