From 47076feb4abc5bc5abd03899345efd4c8f73f1dc Mon Sep 17 00:00:00 2001 From: Hubert de La Jonquiere Date: Fri, 6 Dec 2024 14:58:39 +0100 Subject: [PATCH] PropConst with OpaqueFact --- core/src/optim/prop_const.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/core/src/optim/prop_const.rs b/core/src/optim/prop_const.rs index a26c4eb0ff..9e6b994416 100644 --- a/core/src/optim/prop_const.rs +++ b/core/src/optim/prop_const.rs @@ -55,12 +55,18 @@ impl super::TypedPass for PropConst { } let mut patch = TypedModelPatch::default(); for (ix, output) in res.into_iter().enumerate() { + let opaque_fact = model.outlet_fact(OutletId::new(node.id, ix))?.opaque_fact.clone(); + let name = if ix > 0 { format!("{}.{ix}", node.name) } else { node.name.clone() }; - let wire = patch.add_const(name, output.into_arc_tensor())?; + let wire = patch.wire_node( + name, + Const(output.into_arc_tensor(), opaque_fact), + &[], + )?[0]; patch.shunt_outside(model, (node.id, ix).into(), wire)?; } self.0 = node.id;