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

Method set_output_node

ciphercore-base/src/graphs.rs:3184–3197  ·  view source on GitHub ↗

Promotes a given node to the output node of the parent graph. # Arguments `output_node` - node to be set as output # Example ``` # use ciphercore_base::graphs::create_context; # use ciphercore_base::data_types::{array_type, vector_type, INT32}; let c = create_context().unwrap(); let g = c.create_graph().unwrap(); let t = array_type(vec![3, 2], INT32); let vec_t = vector_type(4, t); let n1 = g.

(&self, output_node: Node)

Source from the content-addressed store, hash-verified

3182 /// g.finalize().unwrap();
3183 /// ```
3184 pub fn set_output_node(&self, output_node: Node) -> Result<()> {
3185 let current_output_node = self.body.borrow().output_node.clone();
3186 match current_output_node {
3187 Some(_) => Err(runtime_error!("Output node is already set")),
3188 None => {
3189 if output_node.get_graph() != *self {
3190 Err(runtime_error!("Output node has to be from the same graph"))
3191 } else {
3192 self.body.borrow_mut().output_node = Some(output_node.downgrade());
3193 Ok(())
3194 }
3195 }
3196 }
3197 }
3198
3199 /// Returns the output node of the graph.
3200 ///

Callers 15

create_dummy_graphFunction · 0.45
run_instantiation_passFunction · 0.45
test_notFunction · 0.45
test_orFunction · 0.45
instantiateMethod · 0.45
test_instantiation_passFunction · 0.45
set_as_outputMethod · 0.45
call_iterate_testFunction · 0.45
test_malformed_graphsFunction · 0.45
test_malformed_contextsFunction · 0.45

Calls 3

cloneMethod · 0.80
downgradeMethod · 0.80
get_graphMethod · 0.45

Tested by 15

test_notFunction · 0.36
test_orFunction · 0.36
test_instantiation_passFunction · 0.36
call_iterate_testFunction · 0.36
test_malformed_graphsFunction · 0.36
test_malformed_contextsFunction · 0.36
test_graph_consistencyFunction · 0.36
test_unfinalized_graphsFunction · 0.36
test_named_contextsFunction · 0.36
test_mux_bitsFunction · 0.36