(
graph: Graph,
nodes: Vec<Node>,
inlining_context: &mut InliningContext,
)
| 301 | } |
| 302 | |
| 303 | fn 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 | |
| 325 | fn unassign_nodes(graph: Graph, inlining_context: &mut InliningContext) -> Result<()> { |
| 326 | for node in graph.get_nodes() { |
no test coverage detected