NodeSpec

Contents

NodeSpec#

class brainstate.graph.NodeSpec(type, index, metadata, fields)[source]#

The static record for a single graph node (never a pytree).

Parameters:
  • type (type) – The node’s Python type.

  • index (int) – Its global index in the flat table.

  • metadata (Any) – Hashable auxiliary data returned by the node’s flatten function ((cls,) for a Node).

  • fields (tuple) – The ordered (key, edge) pairs describing the node’s children.