MCPcopy Index your code
hub / github.com/ciphermodelabs/ciphercore / finalize

Method finalize

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

Checks that the graph has an output node and finalizes the graph. After finalization the graph can't be changed. # Returns Finalized graph # 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 = vecto

(&self)

Source from the content-addressed store, hash-verified

3142 /// g.finalize().unwrap();
3143 /// ```
3144 pub fn finalize(&self) -> Result<Graph> {
3145 let output_node = self.body.borrow_mut().output_node.clone();
3146 match output_node {
3147 Some(_) => {
3148 self.body.borrow_mut().finalized = true;
3149 Ok(self.clone())
3150 }
3151 None => Err(runtime_error!("Output node is not set")),
3152 }
3153 }
3154
3155 /// Returns the vector of nodes contained in the graph in order of construction.
3156 ///

Callers 15

process_nodeMethod · 0.45
create_dummy_graphFunction · 0.45
instantiateMethod · 0.45
process_instantiationFunction · 0.45
run_instantiation_passFunction · 0.45
test_notFunction · 0.45
test_orFunction · 0.45
test_instantiation_passFunction · 0.45
simple_contextFunction · 0.45
call_iterate_testFunction · 0.45

Calls 3

cloneMethod · 0.80
get_graphsMethod · 0.45
check_finalizedMethod · 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