Skip to content

Commit b42c580

Browse files
dvdskosyvokon
andcommitted
Adds onnx operator Reciprocal
Co-authored-by: Oleksiy <[email protected]>
1 parent 372c9cf commit b42c580

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

candle-onnx/src/eval.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,12 @@ fn simple_eval_(
358358
let output = input0.broadcast_div(input1)?;
359359
values.insert(node.output[0].clone(), output);
360360
}
361+
"Reciprocal" => {
362+
let xs = get(&node.input[0])?;
363+
let ones = Tensor::ones_like(&xs)?;
364+
let output = ones.div(xs)?;
365+
values.insert(node.output[0].clone(), output);
366+
}
361367
"Pow" => {
362368
let input0 = get(&node.input[0])?;
363369
let input1 = get(&node.input[1])?;

0 commit comments

Comments
 (0)