Skip to content

Commit

Permalink
shortcut avoiding big salad of nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
kali committed Sep 5, 2024
1 parent 6ceac7c commit 2898b88
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions nnef/src/deser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -669,6 +669,9 @@ impl CoerceFrom<Value> 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::<Arc<Tensor>>(builder) {
return builder.add_const(c)
}
let mut outlets = tvec!();
for i in inputs {
let outlet = OutletId::coerce(builder, i)?;
Expand Down

0 comments on commit 2898b88

Please sign in to comment.