Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kali committed Jan 27, 2024
1 parent 044964a commit 9ee031d
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions onnx/src/ops/resize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ use crate::model::ParsingContext;
use crate::pb::*;
use std::hash::Hash;
use tract_hir::internal::*;
use tract_nnef::tract_num_traits::Zero;

pub fn resize(
ctx: &ParsingContext,
node: &NodeProto,
) -> TractResult<(Box<dyn InferenceOp>, Vec<String>)> {
let op = match ctx.onnx_operator_set_version {
let op = match dbg!(ctx.onnx_operator_set_version) {
10 => resize_10(node)?,
11..=12 => resize_11(node)?,
13..=17 => resize_13(node)?,
Expand Down Expand Up @@ -273,8 +274,14 @@ impl InferenceRulesOp for Resize {
check_output_arity(outputs, 1)?;
s.equals(&inputs[0].datum_type, &outputs[0].datum_type)?;
s.equals(&inputs[0].rank, &outputs[0].rank)?;
if self.optional_scales_input.is_some() {
rules_with_scales(self, s, inputs, outputs)
if let Some(scales) = self.optional_scales_input {
s.given(&inputs[scales].shape[0], move |s, len| {
if len.is_zero() {
rules_with_sizes(self, s, inputs, outputs)
} else {
rules_with_scales(self, s, inputs, outputs)
}
})
} else if self.optional_sizes_input.is_some() {
rules_with_sizes(self, s, inputs, outputs)
} else {
Expand Down

0 comments on commit 9ee031d

Please sign in to comment.