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)
| 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 | /// |