Skip to content

Commit

Permalink
Expose layer_to_index in c-api (#4860)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mek101 committed Jul 16, 2023
1 parent a9a7be0 commit 411a098
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/c_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1056,6 +1056,11 @@ ncnn_layer_t ncnn_layer_create_by_type(const char* type)
layer->forward_inplace_n = __ncnn_layer_forward_inplace_n;
return layer;
}

int ncnn_layer_type_to_index(const char* type)
{
return ncnn::layer_to_index(type);
}
#endif /* NCNN_STRING */

void ncnn_layer_destroy(ncnn_layer_t layer)
Expand Down
1 change: 1 addition & 0 deletions src/c_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ NCNN_EXPORT ncnn_layer_t ncnn_layer_create();
NCNN_EXPORT ncnn_layer_t ncnn_layer_create_by_typeindex(int typeindex);
#if NCNN_STRING
NCNN_EXPORT ncnn_layer_t ncnn_layer_create_by_type(const char* type);
NCNN_EXPORT int ncnn_layer_type_to_index(const char* type);
#endif /* NCNN_STRING */
NCNN_EXPORT void ncnn_layer_destroy(ncnn_layer_t layer);

Expand Down

0 comments on commit 411a098

Please sign in to comment.