@@ -1555,49 +1555,49 @@ Error defineGenericUnaryNode(
15551555 }
15561556
15571557// Macro for unary operations with leaky_relu parameters
1558- #define _DEFINE_UNARY_NODE_WITH_LEAKY_RELU (name ) \
1559- Error define##name##Node( \
1560- xnn_subgraph_t subgraph_ptr, \
1561- const std::unordered_map<uint32_t , uint32_t >& remapped_ids, \
1562- const NodePtr node, \
1563- const fb_xnnpack::XNNGraph* graph) noexcept { \
1564- MAYBE_UNUSED (graph); \
1565- auto graph_node = node->xnode_union_as_XNNLeakyReLU (); \
1566- union xnn_unary_params params; \
1567- params.leaky_relu .negative_slope = graph_node->negative_slope (); \
1568- return defineGenericUnaryNode ( \
1569- subgraph_ptr, \
1570- remapped_ids, \
1571- graph_node->input_id (), \
1572- graph_node->output_id (), \
1573- graph_node->flags (), \
1574- xnn_unary_leaky_relu, \
1575- ¶ms, \
1576- node->xnode_union_type (), \
1577- node->debug_handle ()); \
1558+ #define _DEFINE_UNARY_NODE_WITH_LEAKY_RELU (name ) \
1559+ Error define##name##Node( \
1560+ xnn_subgraph_t subgraph_ptr, \
1561+ const std::unordered_map<uint32_t , uint32_t >& remapped_ids, \
1562+ const NodePtr node, \
1563+ const fb_xnnpack::XNNGraph* graph) noexcept { \
1564+ MAYBE_UNUSED (graph); \
1565+ auto graph_node = node->xnode_union_as_XNNLeakyReLU (); \
1566+ union xnn_unary_params params; \
1567+ params.leaky_relu .negative_slope = graph_node->negative_slope (); \
1568+ return defineGenericUnaryNode ( \
1569+ subgraph_ptr, \
1570+ remapped_ids, \
1571+ graph_node->input_id (), \
1572+ graph_node->output_id (), \
1573+ graph_node->flags (), \
1574+ xnn_unary_leaky_relu, \
1575+ ¶ms, \
1576+ node->xnode_union_type (), \
1577+ node->debug_handle ()); \
15781578 }
15791579
15801580// Macro for unary operations with elu parameters
1581- #define _DEFINE_UNARY_NODE_WITH_ELU (name ) \
1582- Error define##name##Node( \
1583- xnn_subgraph_t subgraph_ptr, \
1584- const std::unordered_map<uint32_t , uint32_t >& remapped_ids, \
1585- const NodePtr node, \
1586- const fb_xnnpack::XNNGraph* graph) noexcept { \
1587- MAYBE_UNUSED (graph); \
1588- auto graph_node = node->xnode_union_as_XNNELU (); \
1589- union xnn_unary_params params; \
1590- params.elu .alpha = graph_node->alpha (); \
1591- return defineGenericUnaryNode ( \
1592- subgraph_ptr, \
1593- remapped_ids, \
1594- graph_node->input_id (), \
1595- graph_node->output_id (), \
1596- graph_node->flags (), \
1597- xnn_unary_elu, \
1598- ¶ms, \
1599- node->xnode_union_type (), \
1600- node->debug_handle ()); \
1581+ #define _DEFINE_UNARY_NODE_WITH_ELU (name ) \
1582+ Error define##name##Node( \
1583+ xnn_subgraph_t subgraph_ptr, \
1584+ const std::unordered_map<uint32_t , uint32_t >& remapped_ids, \
1585+ const NodePtr node, \
1586+ const fb_xnnpack::XNNGraph* graph) noexcept { \
1587+ MAYBE_UNUSED (graph); \
1588+ auto graph_node = node->xnode_union_as_XNNELU (); \
1589+ union xnn_unary_params params; \
1590+ params.elu .alpha = graph_node->alpha (); \
1591+ return defineGenericUnaryNode ( \
1592+ subgraph_ptr, \
1593+ remapped_ids, \
1594+ graph_node->input_id (), \
1595+ graph_node->output_id (), \
1596+ graph_node->flags (), \
1597+ xnn_unary_elu, \
1598+ ¶ms, \
1599+ node->xnode_union_type (), \
1600+ node->debug_handle ()); \
16011601 }
16021602
16031603// Generic helper function for binary operations
@@ -1630,26 +1630,26 @@ Error defineGenericBinaryNode(
16301630}
16311631
16321632// Macro for binary operations with min/max parameters
1633- #define _DEFINE_BINARY_NODE_WITH_MINMAX (name, op_type ) \
1634- Error define##name##Node( \
1635- xnn_subgraph_t subgraph_ptr, \
1636- const std::unordered_map<uint32_t , uint32_t >& remapped_ids, \
1637- const NodePtr node, \
1638- const fb_xnnpack::XNNGraph* graph) noexcept { \
1639- MAYBE_UNUSED (graph); \
1640- auto graph_node = node->xnode_union_as_XNN ##name (); \
1641- std::pair<float , float > min_max = getOutputMinMax (node); \
1642- struct xnn_binary_params params; \
1643- params.output_min = min_max.first ; \
1644- params.output_max = min_max.second ; \
1645- return defineGenericBinaryNode ( \
1646- subgraph_ptr, \
1647- remapped_ids, \
1648- graph_node, \
1649- op_type, \
1650- ¶ms, \
1651- node->xnode_union_type (), \
1652- node->debug_handle ()); \
1633+ #define _DEFINE_BINARY_NODE_WITH_MINMAX (name, op_type ) \
1634+ Error define##name##Node( \
1635+ xnn_subgraph_t subgraph_ptr, \
1636+ const std::unordered_map<uint32_t , uint32_t >& remapped_ids, \
1637+ const NodePtr node, \
1638+ const fb_xnnpack::XNNGraph* graph) noexcept { \
1639+ MAYBE_UNUSED (graph); \
1640+ auto graph_node = node->xnode_union_as_XNN ##name (); \
1641+ std::pair<float , float > min_max = getOutputMinMax (node); \
1642+ struct xnn_binary_params params; \
1643+ params.output_min = min_max.first ; \
1644+ params.output_max = min_max.second ; \
1645+ return defineGenericBinaryNode ( \
1646+ subgraph_ptr, \
1647+ remapped_ids, \
1648+ graph_node, \
1649+ op_type, \
1650+ ¶ms, \
1651+ node->xnode_union_type (), \
1652+ node->debug_handle ()); \
16531653 }
16541654
16551655// Macro for binary operations without parameters
0 commit comments