factor_agent.gate.graph.Graph.record#

classmethod Graph.record(output, vocabulary, strict=True)[source]#

Record every operator output depends on, its inputs and loops first, under vocabulary’s names.

With strict=False (a reference factor’s graph, compared but never rebuilt) an operator outside the vocabulary is recorded under its class name, other state is ignored and an attribute that is not a number, string or bool is recorded as its repr.

Raises:
ValueError

If strict and an operator is not registered or carries state other than its inputs, attributes and loop.