flare.node

Abstraction for a node in a computational graph. The most common thing to use here would be the flare.node/const function for returning a constant

*current-input-scope*

dynamic

const

(const input-name data)(const data)

A node which is a constant in a graph, typically used in dynamic graphs as leaves. The data is either a tensor or the default factory can make a tensor from it.

gen-name

(gen-name prefix)

let-scope

macro

(let-scope bindings & body)

Like let except the right-hand-side of each let binding is wrapped in node/with-scope using the string name of the left-hand-side variable. The goal is to properly nest the names of all nodes and parameters in graph

   (let-scope
     [left (module/affine model 10 [5])
      right (module/affine model 10 [5])]
     (cg/+ left right))

Then the model has ("left/W","left/b", "right/W", "right/b")

scoped-name

(scoped-name node-name)

fully qualified node name with scopes

with-scope

macro

(with-scope scope-name & body)

everything in body gets the scope appended to default scope