Skip to content

Commit

Permalink
fix: in/out dimension problem with onnx model
Browse files Browse the repository at this point in the history
  • Loading branch information
chloeminkyung committed Oct 9, 2023
1 parent ed2b0e0 commit ae58805
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions dozer-sql/expression/src/onnx/udf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,15 @@ pub fn evaluate_onnx_udf(
}
};
input_array.push(num);
} else if let Field::UInt(v) = field {
} else if let Field::UInt(v) = field {
let num = match f32::from_u64(v) {
Some(val) => val,
None => {
return Err(Onnx(InputArgumentOverflow(field.clone(), return_type)))
}
};
input_array.push(num);
} else if let Field::U128(v) = field {
} else if let Field::U128(v) = field {
let num = match f32::from_u128(v) {
Some(val) => val,
None => {
Expand Down Expand Up @@ -154,15 +154,15 @@ pub fn evaluate_onnx_udf(
}
};
input_array.push(num);
} else if let Field::UInt(v) = field {
} else if let Field::UInt(v) = field {
let num = match f64::from_u64(v) {
Some(val) => val,
None => {
return Err(Onnx(InputArgumentOverflow(field.clone(), return_type)))
}
};
input_array.push(num);
} else if let Field::U128(v) = field {
} else if let Field::U128(v) = field {
let num = match f64::from_u128(v) {
Some(val) => val,
None => {
Expand Down Expand Up @@ -773,7 +773,7 @@ fn onnx_output_to_dozer(
Some(v) => {
let result = v[0].into();
Ok(Field::Float(OrderedFloat(result)))
},
}
None => Ok(Field::Null),
}
}
Expand All @@ -787,7 +787,7 @@ fn onnx_output_to_dozer(
Some(v) => {
let result = v[0].into();
Ok(Field::Float(OrderedFloat(result)))
},
}
None => Ok(Field::Null),
}
}
Expand All @@ -801,7 +801,7 @@ fn onnx_output_to_dozer(
Some(v) => {
let result = v[0];
Ok(Field::Float(OrderedFloat(result)))
},
}
None => Ok(Field::Null),
}
}
Expand Down

0 comments on commit ae58805

Please sign in to comment.