Skip to content

Commit

Permalink
make analyse work in the dynamic case
Browse files Browse the repository at this point in the history
  • Loading branch information
kali committed Apr 10, 2023
1 parent 7e98f1b commit 528afb4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 1 addition & 2 deletions hir/src/infer/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,7 @@ impl InferenceModelExt for InferenceModel {
} else {
let outputs = node
.op
.to_typed(source, node, target, mapping)
.with_context(|| format!("translating op {:?}", node.op))?;
.to_typed(source, node, target, mapping)?;
for output in &outputs {
let fact = target.outlet_fact(*output)?;
fact.consistent().with_context(|| {
Expand Down
6 changes: 6 additions & 0 deletions onnx/src/ops/logic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,12 @@ impl InferenceOp for If {
changed =
changed || body.output_fact_mut(oix)?.unify_with_mut(&mut outputs[oix])?;
}
} else {
for ix in 0..self.nboutputs()? {
changed = changed
|| self.then_body.output_fact_mut(ix)?.unify_with_mut(&mut outputs[ix])?
|| self.else_body.output_fact_mut(ix)?.unify_with_mut(&mut outputs[ix])?;
}
}
changed = changed || self.then_body.analyse(false)?;
changed = changed || self.else_body.analyse(false)?;
Expand Down

0 comments on commit 528afb4

Please sign in to comment.