CorTeX Core ABI 7
ToolTech Software · C++ library reference
Loading...
Searching...
No Matches
ctxGraph Class Reference

#include <ctxGraph.h>

Public Member Functions

 ctxGraph ()
gzBool addLayer (const ctxLayer &layer)
gzBool addInput (const gzString &path, gzUInt32 values)
gzBool addDense (const gzString &path, gzUInt32 neurons, ctxNeuronType type=CTX_NEURON_TYPE_DEFAULT)
gzBool addDenseFrom (const gzString &path, gzUInt32 neurons, const ctxPortRef &source, ctxNeuronType type=CTX_NEURON_TYPE_DEFAULT)
 Stages DenseFrom and its complete selected source in one candidate.
gzBool addActivation (const gzString &path, gzUInt32 values, ctxNeuronType type=CTX_NEURON_TYPE_DEFAULT)
gzBool addAdd (const gzString &path, gzUInt32 values, const ctxPortRef &left, const ctxPortRef &right)
 Atomically authors Add and both full ZIP inputs; no bare Add is staged.
gzBool addMultiply (const gzString &path, gzUInt32 values, const ctxPortRef &left, const ctxPortRef &right)
 Atomically authors Multiply and both whole ZIP inputs, including aliases.
gzBool addConvolution2D (const gzString &path, ctxIndexControl source, ctxIndexControl filter, ctxNeuronType type=CTX_NEURON_TYPE_DEFAULT, gzBool sharedBias=TRUE, gzUInt32 maxDebugFeatures=0)
gzBool addOutput (const gzString &path, gzUInt32 values, ctxNeuronType type=CTX_NEURON_TYPE_DEFAULT)
gzUInt32 getOperationCount () const
ctxGraphIdentity getIdentity () const
const ctxGraphOperation * getOperation (gzUInt32 index) const
const ctxGraphOperation * getOperationByID (gzUInt32 occurrenceID) const
gzUInt32 getOperationIndex (gzUInt32 occurrenceID) const
ctxLayerRef getLayer (gzUInt32 index) const
ctxLayerRef layer (const gzString &name) const
ctxLayerRefList layers () const
ctxLayerRefList layers (const gzString &name) const
gzUInt32 getLayerCount (const gzString &name) const
ctxHandleStatus getHandleStatus (const ctxLayerRef &layer) const
ctxHandleStatus getHandleStatus (const ctxNodeRef &node) const
ctxHandleStatus getHandleStatus (const ctxNodeRangeRef &nodes) const
ctxHandleStatus getHandleStatus (const ctxPortRef &port) const
ctxHandleStatus getHandleStatus (const ctxValueRef &value) const
ctxHandleStatus getHandleStatus (const ctxValue &value) const
ctxValue value (const ctxPortRef &output) const
 Rebinds a whole result to this revision; changed ancestor shapes fail.
gzBool apply (const ctxLayer &layer, const ctxValue &input, ctxValue &result)
 Atomically authors occurrence and full explicit edge; result is unchanged on failure.
gzBool apply (const ctxLayer &layer, const ctxValue &left, const ctxValue &right, ctxValue &result)
 Binary Add/Multiply accepts current or shape-preserving ancestor values.
gzBool applyRmsNorm (const gzString &name, gzUInt32 axis, const ctxValue &input, ctxValue &result)
 Atomically authors "name/rstd" = ReduceInverseRms(axis) over input and "name" = MultiplyBroadcast(axis)(input, rstd); graph and result are unchanged on failure.
gzBool apply (const ctxModule &module, const gzString &prefix, const ctxValue &input, ctxValue &result)
 Copies a captured module atomically; graph and result remain unchanged on failure.
ctxHandleStatus getHandleStatus (const ctxConnectionRef &connection) const
ctxHandleStatus getHandleStatus (const ctxConvolutionMappingRef &mapping) const
ctxHandleStatus getHandleStatus (const ctxParameterRef &parameter) const
ctxHandleStatus getHandleStatus (const ctxParameterSlice &parameters) const
ctxConnectionRef connectionInto (const ctxLayerRef &layer) const
ctxConnectionRef connect (const ctxNodeRef &source, const ctxNodeRef &destination)
ctxConnectionRef connect (const ctxNodeRangeRef &source, const ctxNodeRangeRef &destination)
ctxConnectionRef connect (const ctxPortRef &source, const ctxPortRef &destination)
ctxConvolutionMappingRef attachConvolutionMapping (const ctxLayerRef &convolution, const ctxConvolutionMapping &mapping)
gzBool replaceConvolutionMapping (const ctxConvolutionMappingRef &current, const ctxConvolutionMapping &replacement)
gzBool removeConvolutionMapping (const ctxConvolutionMappingRef &mapping)
gzBool shareConvolutionParameters (const ctxConvolutionMappingRef &first, const ctxConvolutionMappingRef &second)
gzBool disconnect (const ctxConnectionRef &connection)
gzBool remove (const ctxLayerRef &layer)
gzBool replace (const ctxLayerRef &layer, const ctxLayer &replacement)
 Replaces a non-marker with Dense, or a unary occurrence with a same-shaped captured schema.
gzBool replaceConvolution2D (const ctxLayerRef &layer, ctxIndexControl source, ctxIndexControl filter, ctxNeuronType type=CTX_NEURON_TYPE_DEFAULT, gzBool sharedBias=TRUE, gzUInt32 maxDebugFeatures=0)
gzBool share (const ctxParameterRef &first, const ctxParameterRef &second)
gzBool share (const ctxParameterSlice &first, const ctxParameterSlice &second)
gzBool share (const gzArray< ctxParameterRef > &first, const gzArray< ctxParameterRef > &second)
 Shares every pair first[i]/second[i] in one validated commit; any invalid pair rejects all.
gzBool unshare (const ctxParameterRef &parameter)
gzBool validate ()
gzString getCanonicalSignature () const
gzString getError () const
gzBool save (const gzString &url) const

Static Public Member Functions

static gzBool load (const gzString &url, ctxGraph &graph, gzString *error=NULL)
static gzBool registerXmlType (const gzString &elementName, gzXmlCustomDataInterface *customDataInterface, gzBool replace=FALSE)
static gzVoid unregisterXmlType (gzXmlCustomDataInterface *customDataInterface)
static gzBool registerOperationLowerer (ctxGraphOperationType type, ctxGraphOperationLowerer *lowerer, gzBool replace=FALSE)
static gzBool registerConnectionLowerer (ctxGraphOperationType type, ctxGraphConnectionLowerer *lowerer, gzBool replace=FALSE)
static ctxGraphOperationLowerer * getOperationLowerer (ctxGraphOperationType type)
static ctxGraphConnectionLowerer * getConnectionLowerer (ctxGraphOperationType type)
static gzVoid unregisterOperationLowerer (ctxGraphOperationLowerer *lowerer)
static gzVoid unregisterConnectionLowerer (ctxGraphConnectionLowerer *lowerer)
static gzBool registerOperationSchema (ctxOperationSchema *schema)
 Duplicate definitions require a new version; unregister only disables lookup.
static gzBool unregisterOperationSchema (const gzString &key, gzUInt32 version)
static ctxOperationSchemaPtr getOperationSchema (const gzString &key, gzUInt32 version)
static ctxOperationSchemaPtr getBuiltinSchema (ctxGraphOperationType type)
 Captures the currently installed legacy lowerers for subsequent authoring.

Friends

class ctxModel
class ctxValue
class ctxGraphDocument
class ctxModule
ctxGraph operator+ (const ctxLayer &left, const ctxLayer &right)
ctxGraph operator+ (const ctxGraph &graph, const ctxLayer &layer)

Detailed Description

Definition at line 1123 of file ctxGraph.h.

Constructor & Destructor Documentation

◆ ctxGraph()

ctxGraph::ctxGraph ( )

References CTX_EXPORT.

Referenced by ctxModule, load(), operator+, and operator+.

Member Function Documentation

◆ addActivation()

gzBool ctxGraph::addActivation ( const gzString & path,
gzUInt32 values,
ctxNeuronType type = CTX_NEURON_TYPE_DEFAULT )

◆ addAdd()

gzBool ctxGraph::addAdd ( const gzString & path,
gzUInt32 values,
const ctxPortRef & left,
const ctxPortRef & right )

Atomically authors Add and both full ZIP inputs; no bare Add is staged.

References CTX_EXPORT.

◆ addConvolution2D()

gzBool ctxGraph::addConvolution2D ( const gzString & path,
ctxIndexControl source,
ctxIndexControl filter,
ctxNeuronType type = CTX_NEURON_TYPE_DEFAULT,
gzBool sharedBias = TRUE,
gzUInt32 maxDebugFeatures = 0 )

◆ addDense()

gzBool ctxGraph::addDense ( const gzString & path,
gzUInt32 neurons,
ctxNeuronType type = CTX_NEURON_TYPE_DEFAULT )

◆ addDenseFrom()

gzBool ctxGraph::addDenseFrom ( const gzString & path,
gzUInt32 neurons,
const ctxPortRef & source,
ctxNeuronType type = CTX_NEURON_TYPE_DEFAULT )

Stages DenseFrom and its complete selected source in one candidate.

References CTX_EXPORT, and CTX_NEURON_TYPE_DEFAULT.

◆ addInput()

gzBool ctxGraph::addInput ( const gzString & path,
gzUInt32 values )

References CTX_EXPORT.

◆ addLayer()

gzBool ctxGraph::addLayer ( const ctxLayer & layer)

References CTX_EXPORT, and layer().

◆ addMultiply()

gzBool ctxGraph::addMultiply ( const gzString & path,
gzUInt32 values,
const ctxPortRef & left,
const ctxPortRef & right )

Atomically authors Multiply and both whole ZIP inputs, including aliases.

References CTX_EXPORT.

◆ addOutput()

gzBool ctxGraph::addOutput ( const gzString & path,
gzUInt32 values,
ctxNeuronType type = CTX_NEURON_TYPE_DEFAULT )

◆ apply() [1/3]

gzBool ctxGraph::apply ( const ctxLayer & layer,
const ctxValue & input,
ctxValue & result )

Atomically authors occurrence and full explicit edge; result is unchanged on failure.

References CTX_EXPORT, ctxValue, and layer().

◆ apply() [2/3]

gzBool ctxGraph::apply ( const ctxLayer & layer,
const ctxValue & left,
const ctxValue & right,
ctxValue & result )

Binary Add/Multiply accepts current or shape-preserving ancestor values.

References CTX_EXPORT, ctxValue, and layer().

◆ apply() [3/3]

gzBool ctxGraph::apply ( const ctxModule & module,
const gzString & prefix,
const ctxValue & input,
ctxValue & result )

Copies a captured module atomically; graph and result remain unchanged on failure.

References CTX_EXPORT, ctxModule, and ctxValue.

◆ applyRmsNorm()

gzBool ctxGraph::applyRmsNorm ( const gzString & name,
gzUInt32 axis,
const ctxValue & input,
ctxValue & result )

Atomically authors "name/rstd" = ReduceInverseRms(axis) over input and "name" = MultiplyBroadcast(axis)(input, rstd); graph and result are unchanged on failure.

References CTX_EXPORT, and ctxValue.

◆ attachConvolutionMapping()

ctxConvolutionMappingRef ctxGraph::attachConvolutionMapping ( const ctxLayerRef & convolution,
const ctxConvolutionMapping & mapping )

References CTX_EXPORT.

◆ connect() [1/3]

ctxConnectionRef ctxGraph::connect ( const ctxNodeRangeRef & source,
const ctxNodeRangeRef & destination )

References CTX_EXPORT.

◆ connect() [2/3]

ctxConnectionRef ctxGraph::connect ( const ctxNodeRef & source,
const ctxNodeRef & destination )

References CTX_EXPORT.

◆ connect() [3/3]

ctxConnectionRef ctxGraph::connect ( const ctxPortRef & source,
const ctxPortRef & destination )

References CTX_EXPORT.

◆ connectionInto()

ctxConnectionRef ctxGraph::connectionInto ( const ctxLayerRef & layer) const

References CTX_EXPORT, and layer().

◆ disconnect()

gzBool ctxGraph::disconnect ( const ctxConnectionRef & connection)

References CTX_EXPORT.

◆ getBuiltinSchema()

ctxOperationSchemaPtr ctxGraph::getBuiltinSchema ( ctxGraphOperationType type)
static

Captures the currently installed legacy lowerers for subsequent authoring.

References CTX_EXPORT.

◆ getCanonicalSignature()

gzString ctxGraph::getCanonicalSignature ( ) const

References CTX_EXPORT.

◆ getConnectionLowerer()

ctxGraphConnectionLowerer * ctxGraph::getConnectionLowerer ( ctxGraphOperationType type)
static

References CTX_EXPORT.

◆ getError()

gzString ctxGraph::getError ( ) const

References CTX_EXPORT.

◆ getHandleStatus() [1/10]

ctxHandleStatus ctxGraph::getHandleStatus ( const ctxConnectionRef & connection) const

References CTX_EXPORT.

◆ getHandleStatus() [2/10]

ctxHandleStatus ctxGraph::getHandleStatus ( const ctxConvolutionMappingRef & mapping) const

References CTX_EXPORT.

◆ getHandleStatus() [3/10]

ctxHandleStatus ctxGraph::getHandleStatus ( const ctxLayerRef & layer) const

References CTX_EXPORT, and layer().

◆ getHandleStatus() [4/10]

ctxHandleStatus ctxGraph::getHandleStatus ( const ctxNodeRangeRef & nodes) const

References CTX_EXPORT.

◆ getHandleStatus() [5/10]

ctxHandleStatus ctxGraph::getHandleStatus ( const ctxNodeRef & node) const

References CTX_EXPORT.

◆ getHandleStatus() [6/10]

ctxHandleStatus ctxGraph::getHandleStatus ( const ctxParameterRef & parameter) const

References CTX_EXPORT.

◆ getHandleStatus() [7/10]

ctxHandleStatus ctxGraph::getHandleStatus ( const ctxParameterSlice & parameters) const

References CTX_EXPORT.

◆ getHandleStatus() [8/10]

ctxHandleStatus ctxGraph::getHandleStatus ( const ctxPortRef & port) const

References CTX_EXPORT.

◆ getHandleStatus() [9/10]

ctxHandleStatus ctxGraph::getHandleStatus ( const ctxValue & value) const

References CTX_EXPORT, ctxValue, and value().

◆ getHandleStatus() [10/10]

ctxHandleStatus ctxGraph::getHandleStatus ( const ctxValueRef & value) const

References CTX_EXPORT, and value().

◆ getIdentity()

ctxGraphIdentity ctxGraph::getIdentity ( ) const

References CTX_EXPORT.

◆ getLayer()

ctxLayerRef ctxGraph::getLayer ( gzUInt32 index) const

References CTX_EXPORT.

◆ getLayerCount()

gzUInt32 ctxGraph::getLayerCount ( const gzString & name) const

References CTX_EXPORT.

◆ getOperation()

const ctxGraphOperation * ctxGraph::getOperation ( gzUInt32 index) const

References CTX_EXPORT.

◆ getOperationByID()

const ctxGraphOperation * ctxGraph::getOperationByID ( gzUInt32 occurrenceID) const

References CTX_EXPORT.

◆ getOperationCount()

gzUInt32 ctxGraph::getOperationCount ( ) const

References CTX_EXPORT.

◆ getOperationIndex()

gzUInt32 ctxGraph::getOperationIndex ( gzUInt32 occurrenceID) const

References CTX_EXPORT.

◆ getOperationLowerer()

ctxGraphOperationLowerer * ctxGraph::getOperationLowerer ( ctxGraphOperationType type)
static

References CTX_EXPORT.

◆ getOperationSchema()

ctxOperationSchemaPtr ctxGraph::getOperationSchema ( const gzString & key,
gzUInt32 version )
static

References CTX_EXPORT.

◆ layer()

ctxLayerRef ctxGraph::layer ( const gzString & name) const

◆ layers() [1/2]

ctxLayerRefList ctxGraph::layers ( ) const

References CTX_EXPORT.

◆ layers() [2/2]

ctxLayerRefList ctxGraph::layers ( const gzString & name) const

References CTX_EXPORT.

◆ load()

gzBool ctxGraph::load ( const gzString & url,
ctxGraph & graph,
gzString * error = NULL )
static

References CTX_EXPORT, and ctxGraph().

◆ registerConnectionLowerer()

gzBool ctxGraph::registerConnectionLowerer ( ctxGraphOperationType type,
ctxGraphConnectionLowerer * lowerer,
gzBool replace = FALSE )
static

References CTX_EXPORT, and replace().

◆ registerOperationLowerer()

gzBool ctxGraph::registerOperationLowerer ( ctxGraphOperationType type,
ctxGraphOperationLowerer * lowerer,
gzBool replace = FALSE )
static

References CTX_EXPORT, and replace().

◆ registerOperationSchema()

gzBool ctxGraph::registerOperationSchema ( ctxOperationSchema * schema)
static

Duplicate definitions require a new version; unregister only disables lookup.

The caller must establish typed creator ownership before registering. Registration is an externally serialized installation/startup operation.

References CTX_EXPORT.

◆ registerXmlType()

gzBool ctxGraph::registerXmlType ( const gzString & elementName,
gzXmlCustomDataInterface * customDataInterface,
gzBool replace = FALSE )
static

References CTX_EXPORT, and replace().

◆ remove()

gzBool ctxGraph::remove ( const ctxLayerRef & layer)

References CTX_EXPORT, and layer().

◆ removeConvolutionMapping()

gzBool ctxGraph::removeConvolutionMapping ( const ctxConvolutionMappingRef & mapping)

References CTX_EXPORT.

◆ replace()

gzBool ctxGraph::replace ( const ctxLayerRef & layer,
const ctxLayer & replacement )

Replaces a non-marker with Dense, or a unary occurrence with a same-shaped captured schema.

Named-to-named unary replacement also preserves role names, order and shapes.

References CTX_EXPORT, and layer().

Referenced by registerConnectionLowerer(), registerOperationLowerer(), and registerXmlType().

◆ replaceConvolution2D()

gzBool ctxGraph::replaceConvolution2D ( const ctxLayerRef & layer,
ctxIndexControl source,
ctxIndexControl filter,
ctxNeuronType type = CTX_NEURON_TYPE_DEFAULT,
gzBool sharedBias = TRUE,
gzUInt32 maxDebugFeatures = 0 )

◆ replaceConvolutionMapping()

gzBool ctxGraph::replaceConvolutionMapping ( const ctxConvolutionMappingRef & current,
const ctxConvolutionMapping & replacement )

References CTX_EXPORT.

◆ save()

gzBool ctxGraph::save ( const gzString & url) const

References CTX_EXPORT.

◆ share() [1/3]

gzBool ctxGraph::share ( const ctxParameterRef & first,
const ctxParameterRef & second )

References CTX_EXPORT.

◆ share() [2/3]

gzBool ctxGraph::share ( const ctxParameterSlice & first,
const ctxParameterSlice & second )

References CTX_EXPORT.

◆ share() [3/3]

gzBool ctxGraph::share ( const gzArray< ctxParameterRef > & first,
const gzArray< ctxParameterRef > & second )

Shares every pair first[i]/second[i] in one validated commit; any invalid pair rejects all.

References CTX_EXPORT.

◆ shareConvolutionParameters()

gzBool ctxGraph::shareConvolutionParameters ( const ctxConvolutionMappingRef & first,
const ctxConvolutionMappingRef & second )

References CTX_EXPORT.

◆ unregisterConnectionLowerer()

gzVoid ctxGraph::unregisterConnectionLowerer ( ctxGraphConnectionLowerer * lowerer)
static

References CTX_EXPORT.

◆ unregisterOperationLowerer()

gzVoid ctxGraph::unregisterOperationLowerer ( ctxGraphOperationLowerer * lowerer)
static

References CTX_EXPORT.

◆ unregisterOperationSchema()

gzBool ctxGraph::unregisterOperationSchema ( const gzString & key,
gzUInt32 version )
static

References CTX_EXPORT.

◆ unregisterXmlType()

gzVoid ctxGraph::unregisterXmlType ( gzXmlCustomDataInterface * customDataInterface)
static

References CTX_EXPORT.

◆ unshare()

gzBool ctxGraph::unshare ( const ctxParameterRef & parameter)

References CTX_EXPORT.

◆ validate()

gzBool ctxGraph::validate ( )

References CTX_EXPORT.

◆ value()

ctxValue ctxGraph::value ( const ctxPortRef & output) const

Rebinds a whole result to this revision; changed ancestor shapes fail.

References CTX_EXPORT, and ctxValue.

Referenced by getHandleStatus(), and getHandleStatus().

◆ ctxGraphDocument

friend class ctxGraphDocument
friend

Definition at line 1242 of file ctxGraph.h.

References ctxGraphDocument.

Referenced by ctxGraphDocument.

◆ ctxModel

friend class ctxModel
friend

Definition at line 1240 of file ctxGraph.h.

References ctxModel.

Referenced by ctxModel.

◆ ctxModule

friend class ctxModule
friend

Definition at line 1243 of file ctxGraph.h.

References ctxGraph(), and ctxModule.

Referenced by apply(), and ctxModule.

◆ ctxValue

friend class ctxValue
friend

Definition at line 1241 of file ctxGraph.h.

References ctxValue.

Referenced by apply(), apply(), apply(), applyRmsNorm(), ctxValue, getHandleStatus(), and value().

◆ operator+ [1/2]

ctxGraph operator+ ( const ctxGraph & graph,
const ctxLayer & layer )
friend

References CTX_EXPORT, ctxGraph(), and layer().

◆ operator+ [2/2]

ctxGraph operator+ ( const ctxLayer & left,
const ctxLayer & right )
friend

References CTX_EXPORT, and ctxGraph().


The documentation for this class was generated from the following file: