Closed
Description
Current Problem
Code the Neg operator respecting the (Neg Onnx Standard)[https://onnx.ai/onnx/operators/onnx__Neg.html]
To complete this issue you must:
- write the standard and lean math
- write the tests for the math
- write the codegen (math_handler and shape_handler, use the same get_Neg_output_shape() you wrote for the standard math)
- write the function inside the onnx_gen.py
Rules
ONNX standard
Every math method must respect the onnx representation.
You can find all the necessary details about onnx operators here !
Standard & lean format
The "standard version" of a method is in the format:
pub fn methodName (args) !Tensor(T) {
...
outputShape = compute output shape...
outputTensor = compute output tensor...
...
methodName_lean(input, args..., output)
return outputTensor;
}
It is suggested to write a get_methodName_oputput_shape()
to compute the shape of the output so that the same method can be called during the generation of the readyGraph.
The "lean version" of a method is in the format:
pub inline fn methodName_lean (args) void {
...
... actual computation of the output
}
"lean" and "standard" are mandatory.
The lean version is called during the codegen and the standard version is used in testings.