Unverified Commit 3167b167 authored by Artur Wojcik's avatar Artur Wojcik Committed by GitHub

onnx: remove unlikely macro (#1847)

Signed-off-by: 's avatarArtur Wojcik <artur.wojcik@intel.com>
parent 7b4be37e
...@@ -23,9 +23,6 @@ ...@@ -23,9 +23,6 @@
#include "operator_set.hpp" #include "operator_set.hpp"
#include "tensor.hpp" #include "tensor.hpp"
#define likely(__x) __builtin_expect(!!(__x), 1)
#define unlikely(__x) __builtin_expect(!!(__x), 0)
namespace ngraph namespace ngraph
{ {
namespace onnx_import namespace onnx_import
...@@ -139,7 +136,7 @@ namespace ngraph ...@@ -139,7 +136,7 @@ namespace ngraph
template <> template <>
inline std::size_t get_value(const onnx::AttributeProto& attribute) inline std::size_t get_value(const onnx::AttributeProto& attribute)
{ {
if (unlikely(attribute.type() != onnx::AttributeProto_AttributeType_INT)) if (attribute.type() != onnx::AttributeProto_AttributeType_INT)
{ {
throw error::attribute::InvalidData{attribute.type()}; throw error::attribute::InvalidData{attribute.type()};
} }
...@@ -162,7 +159,7 @@ namespace ngraph ...@@ -162,7 +159,7 @@ namespace ngraph
template <> template <>
inline int64_t get_value(const onnx::AttributeProto& attribute) inline int64_t get_value(const onnx::AttributeProto& attribute)
{ {
if (unlikely(attribute.type() != onnx::AttributeProto_AttributeType_INT)) if (attribute.type() != onnx::AttributeProto_AttributeType_INT)
{ {
throw error::attribute::InvalidData{attribute.type()}; throw error::attribute::InvalidData{attribute.type()};
} }
...@@ -184,7 +181,7 @@ namespace ngraph ...@@ -184,7 +181,7 @@ namespace ngraph
template <> template <>
inline std::string get_value(const onnx::AttributeProto& attribute) inline std::string get_value(const onnx::AttributeProto& attribute)
{ {
if (unlikely(attribute.type() != onnx::AttributeProto_AttributeType_STRING)) if (attribute.type() != onnx::AttributeProto_AttributeType_STRING)
{ {
throw error::attribute::InvalidData{attribute.type()}; throw error::attribute::InvalidData{attribute.type()};
} }
...@@ -206,7 +203,7 @@ namespace ngraph ...@@ -206,7 +203,7 @@ namespace ngraph
template <> template <>
inline Tensor get_value(const onnx::AttributeProto& attribute) inline Tensor get_value(const onnx::AttributeProto& attribute)
{ {
if (unlikely(attribute.type() != onnx::AttributeProto_AttributeType_TENSOR)) if (attribute.type() != onnx::AttributeProto_AttributeType_TENSOR)
{ {
throw error::attribute::InvalidData{attribute.type()}; throw error::attribute::InvalidData{attribute.type()};
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment