From 2898b88bd882c09757707bae93a7f426ac840ae2 Mon Sep 17 00:00:00 2001 From: Mathieu Poumeyrol Date: Thu, 5 Sep 2024 10:22:32 +0200 Subject: [PATCH] shortcut avoiding big salad of nodes --- nnef/src/deser.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nnef/src/deser.rs b/nnef/src/deser.rs index aebf1fca99..beee27379b 100644 --- a/nnef/src/deser.rs +++ b/nnef/src/deser.rs @@ -669,6 +669,9 @@ impl CoerceFrom for OutletId { Value::Wire(outlet) => Ok(*outlet), Value::Tuple(tuple) if tuple.len() == 1 => OutletId::coerce(builder, &tuple[0]), Value::Array(inputs) => { + if let Ok(c) = from.to::>(builder) { + return builder.add_const(c) + } let mut outlets = tvec!(); for i in inputs { let outlet = OutletId::coerce(builder, i)?;