[nnc] Replace ElementwiseOp args number deserialization with generated number (#2678)
authorТимур Отеллович Аблязимов/AI Tools Lab /SRR/Staff Engineer/삼성전자 <t.ablyazimov@samsung.com>
Fri, 14 Dec 2018 19:41:24 +0000 (22:41 +0300)
committerEfimov Alexander/AI Tools Lab/./Samsung Electronics <a.efimov@samsung.com>
Fri, 14 Dec 2018 19:41:24 +0000 (22:41 +0300)
[nnc] Issue: SVACE STATIC_OVERFLOW in soft_backend/code_snippets/cpp_operations.def

Signed-off-by: Timur Ablyazimov <t.ablyazimov@samsung.com>
contrib/nnc/passes/soft_backend/SBSerializer.cpp
contrib/nnc/passes/soft_backend/code_snippets/cpp_operations.def

index d8e3d45..3c8b7f6 100644 (file)
@@ -295,7 +295,6 @@ void Serializer::visit(mir::ops::TanhOp& op) {
 void Serializer::visit(mir::ops::ElementwiseOp& op) {
   _curOp->_paramStartOffset = _buffer.size();
   // Op type is known at codegen Time
-  serializeT<int>((int32_t)op.getNumInputs());
   serializeT<int>((int32_t)op.getBroadcast());
   serializeShape(op.getOutputShape(0));
 }
index 508fe53..bcbc917 100644 (file)
@@ -483,7 +483,7 @@ void ElementWise(Tensor &out,
   const float *input[] = {inputs.getData()...};
   RuntimeShape in_shapes[] = {shapeToRuntimeShape(inputs.getShape())...};
 
-  const int32_t num_inputs = deserializeT<int32_t>(params);
+  const int32_t num_inputs = sizeof(input) / sizeof(const float*);
   const bool needs_broadcast = (bool)deserializeT<int32_t>(params);
   const Shape out_shape = deserializeShape(params);