aboutsummaryrefslogtreecommitdiff
path: root/reference_model/src/ops/ewise_binary.h
diff options
context:
space:
mode:
Diffstat (limited to 'reference_model/src/ops/ewise_binary.h')
-rw-r--r--reference_model/src/ops/ewise_binary.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/reference_model/src/ops/ewise_binary.h b/reference_model/src/ops/ewise_binary.h
index 6b9c98d..a5b1059 100644
--- a/reference_model/src/ops/ewise_binary.h
+++ b/reference_model/src/ops/ewise_binary.h
@@ -176,7 +176,7 @@ protected:
TosaMulAttribute* attribute;
};
-template <int Rank>
+template <int Rank, DType InDtype>
class OpTable : public GraphNode
{
public:
@@ -186,9 +186,8 @@ public:
virtual int checkTensorAttributes();
virtual int eval();
- static constexpr DType InDtype = DType_INT16;
- static constexpr DType TableDtype = DType_INT16;
- static constexpr DType OutDtype = DType_INT32;
+ static constexpr DType TableDtype = (InDtype == DType_INT8) ? DType_INT8 : DType_INT16;
+ static constexpr DType OutDtype = (InDtype == DType_INT8) ? DType_INT8 : DType_INT32;
using InEigenType = typename GetEigenType<InDtype>::type;
using TableEigenType = typename GetEigenType<TableDtype>::type;
using OutEigenType = typename GetEigenType<OutDtype>::type;