MCPcopy Create free account
hub / github.com/ciphermodelabs/ciphercore / assign_input_nodes

Function assign_input_nodes

ciphercore-base/src/inline/inline_ops.rs:303–323  ·  view source on GitHub ↗
(
    graph: Graph,
    nodes: Vec<Node>,
    inlining_context: &mut InliningContext,
)

Source from the content-addressed store, hash-verified

301}
302
303fn assign_input_nodes(
304 graph: Graph,
305 nodes: Vec<Node>,
306 inlining_context: &mut InliningContext,
307) -> Result<()> {
308 let mut input_nodes = vec![];
309 for node in graph.get_nodes() {
310 if node.get_operation().is_input() {
311 input_nodes.push(node.clone());
312 }
313 }
314 if input_nodes.len() != nodes.len() {
315 return Err(runtime_error!("Mismatch in the number of nodes"));
316 }
317 for (input_node, node) in input_nodes.iter().zip(nodes.iter()) {
318 inlining_context
319 .ephemeral_context_mapping
320 .insert_node(input_node.clone(), node.clone());
321 }
322 Ok(())
323}
324
325fn unassign_nodes(graph: Graph, inlining_context: &mut InliningContext) -> Result<()> {
326 for node in graph.get_nodes() {

Callers 2

assign_input_nodesMethod · 0.85
inline_callFunction · 0.85

Calls 7

is_inputMethod · 0.80
cloneMethod · 0.80
get_nodesMethod · 0.45
get_operationMethod · 0.45
pushMethod · 0.45
zipMethod · 0.45
insert_nodeMethod · 0.45

Tested by

no test coverage detected