[nnc] Fix incorrect operation id for leaky relu (#2815)
authorVladimir Plazun/AI Tools Lab /SRR/Engineer/삼성전자 <v.plazun@samsung.com>
Thu, 10 Jan 2019 15:40:22 +0000 (18:40 +0300)
committerРоман Михайлович Русяев/AI Tools Lab /SRR/Staff Engineer/삼성전자 <r.rusyaev@samsung.com>
Thu, 10 Jan 2019 15:40:22 +0000 (18:40 +0300)
Id of LeakyRelu operation was incorrectly set as ReLU

Signed-off-by: Vladimir Plazun <v.plazun@partner.samsung.com>
contrib/nnc/include/core/modelIR/operations/LeakyReluOp.h
contrib/nnc/unittests/soft_backend/CPPOperations.cpp

index b968a07..0ff8964 100644 (file)
@@ -26,7 +26,7 @@ namespace ops {
 class LeakyReluOp : public Operation {
 public:
   explicit LeakyReluOp(const IODescriptor& arg, float alpha)
-  : Operation(Type::ReLU, {arg}), _alpha(alpha) {
+  : Operation(Type::leakyReLU, {arg}), _alpha(alpha) {
     // Infer output shape.
     setOutputShape(0, getInputShape(0));
   }
index da93b33..e3068cb 100644 (file)
@@ -810,7 +810,7 @@ TEST(cpp_operations_test, leaky_relu) {
     return g.create<mir::ops::LeakyReluOp>("y", inputs[0], 0.1);
   };
 
-  createAndRunTestGraph(op_generator, relu, input_ntensors, input_atensor);
+  createAndRunTestGraph(op_generator, leakyRelu, input_ntensors, input_atensor);
 }
 
 TEST(cpp_operations_test, sigmoid) {