DriftTexture · function
createGraphEvaluator
Validate, size every value once, and return something that evaluates without allocating.
Explained in DriftTexture.
function createGraphEvaluator(graph: NetworkGraph): GraphEvaluatorimport { createGraphEvaluator } from '@driftengine/texture';Parameters
| Parameter | Type | Description |
|---|---|---|
graph | NetworkGraph |
In depth
Values that cannot be alive at once share a buffer, by planReuse — the rule the device's
runner plans by too. Weights and inputs stay in the caller's own arrays and are planned by
neither. What it buys is the difference between holding every value of a graph and holding the
few alive at any moment: OWLv2's image graph at 960² is 3,647 MB of values and 196 MB in ten buffers,
which is the difference between a reference that runs on an ordinary machine and one that is
killed for its memory.