Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

c_api: expose layer_to_index #4860

Merged
merged 2 commits into from
Jul 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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