Onnx Support for Sign operation #2641 (#2642)

* Support for Sign operation #2641

* Apply rustfmt.

---------

Co-authored-by: Laurent <laurent.mazare@gmail.com>
This commit is contained in:
Ionut Mihalcea
2024-11-26 23:10:09 +01:00
committed by GitHub
parent b4deb5c5a9
commit 21c686387c
2 changed files with 47 additions and 0 deletions

View File

@ -1944,6 +1944,12 @@ fn simple_eval_(
values.insert(node.output[0].clone(), out);
}
// https://onnx.ai/onnx/operators/onnx__Sign.html
"Sign" => {
let input = get(&node.input[0])?;
let output = input.sign()?;
values.insert(node.output[0].clone(), output);
}
op_type => bail!("unsupported op_type {op_type} for op {node:?}"),
}
}