@@ -1345,6 +1345,36 @@ Error defineSquareRootNode(
1345
1345
return Error::Ok;
1346
1346
}
1347
1347
1348
+ /*
1349
+ Define serialized square root node into the subgraph, using the remapped ids
1350
+ to map the serialized ids, to the new ids generated when defining the
1351
+ tensor value
1352
+ */
1353
+ Error defineReciprocalSquareRootNode (
1354
+ xnn_subgraph_t subgraph_ptr,
1355
+ const std::unordered_map<uint32_t , uint32_t >& remapped_ids,
1356
+ const NodePtr node,
1357
+ const fb_xnnpack::XNNGraph* graph) noexcept {
1358
+ MAYBE_UNUSED (graph);
1359
+
1360
+ auto graph_node = node->xnode_union_as_XNNReciprocalSquareRoot ();
1361
+
1362
+ xnn_status status = xnn_define_reciprocal_square_root (
1363
+ subgraph_ptr,
1364
+ remapped_ids.at (graph_node->input_id ()),
1365
+ remapped_ids.at (graph_node->output_id ()),
1366
+ graph_node->flags ());
1367
+
1368
+ ET_CHECK_OR_RETURN_ERROR (
1369
+ status == xnn_status_success,
1370
+ Internal,
1371
+ " Failed to create reciprocal square root node %i with code: %s" ,
1372
+ node->debug_handle (),
1373
+ xnn_status_to_string (status));
1374
+
1375
+ return Error::Ok;
1376
+ }
1377
+
1348
1378
/*
1349
1379
Define serialized ceiling node into the subgraph, using the remapped ids
1350
1380
to map the serialized ids, to the new ids generated when defining the
@@ -1904,6 +1934,7 @@ DefineNodeFunc getDefineNodeFunc(fb_xnnpack::XNodeUnion nodeType) {
1904
1934
_DEFINE (StaticReshape)
1905
1935
_DEFINE (ArgMaxPooling2d)
1906
1936
_DEFINE (SquareRoot)
1937
+ _DEFINE (ReciprocalSquareRoot)
1907
1938
_DEFINE (Ceiling)
1908
1939
_DEFINE (Hardswish)
1909
1940
_DEFINE (LeakyReLU)
0 commit comments