Skip to content

Commit

Permalink
Use iterator syntax instead of operating over index
Browse files Browse the repository at this point in the history
  • Loading branch information
JC committed Jul 19, 2024
1 parent 9391a5d commit 5e26597
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Binary file modified crates/burn-import/onnx-tests/tests/pad/pad.onnx
Binary file not shown.
4 changes: 2 additions & 2 deletions crates/burn-import/src/onnx/op_configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -785,8 +785,8 @@ pub fn pad_config(node: &Node) -> PadConfig {
let bottom_index = pads.len() - 2;
let index_list = [left_index, top_index, right_index, bottom_index];

for index in 0..pads.len() {
if !index_list.contains(&index) && pads[index] != 0 {
for (index, &item) in pads.iter().enumerate() {
if !index_list.contains(&index) && item != 0 {
panic!("Pad: padding will only be applied to the last two dimensions but found non zero padding for other dimensions");
}
}
Expand Down

0 comments on commit 5e26597

Please sign in to comment.