Skip to content

Commit fe5da0a

Browse files
committed
lint
1 parent 32c29e5 commit fe5da0a

File tree

2 files changed

+62
-61
lines changed

2 files changed

+62
-61
lines changed

backends/xnnpack/runtime/XNNCompiler.cpp

Lines changed: 60 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -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-
&params, \
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+
&params, \
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-
&params, \
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+
&params, \
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-
&params, \
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+
&params, \
1651+
node->xnode_union_type(), \
1652+
node->debug_handle()); \
16531653
}
16541654

16551655
// Macro for binary operations without parameters

backends/xnnpack/runtime/XNNWeightsCache.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,8 @@ size_t XNNWeightsCache::look_up_or_insert(
230230
}
231231
PackedDataMeta packed_data_metadata;
232232
packed_data_metadata.offset = next_offset;
233-
packed_data_metadata.ref_count = 0; // ref_count is only incremented after finalizing for runtime
233+
packed_data_metadata.ref_count =
234+
0; // ref_count is only incremented after finalizing for runtime
234235
packed_data_metadata.in_current_runtime = true;
235236
context->name_to_packed_data_metadata_[weight_bias_name] =
236237
packed_data_metadata;

0 commit comments

Comments
 (0)