Skip to content

Binding error when overload the constructor #9704

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

Open
akineeic opened this issue Oct 25, 2019 · 3 comments · May be fixed by #12973
Open

Binding error when overload the constructor #9704

akineeic opened this issue Oct 25, 2019 · 3 comments · May be fixed by #12973
Assignees

Comments

@akineeic
Copy link

akineeic commented Oct 25, 2019

Hello,

I'm getting an error when trying to overload the constructor of Runtimeshape (class of tflite).

  • Environment Info
    OS => Ubuntu 18.04
    Emscripten => fastcomp 1.38.41 or later
    Tensorflow => 1.13

  • The binding code

class_<RuntimeShape>("RuntimeShape")
    .constructor<int>(select_overload<RuntimeShape(int)>([](int dimensions_count) {
        return RuntimeShape(dimensions_count);
      }
    ))
  • Error message:
In file included from /home/zzm/projects/webml-polyfill/src/nn/wasm/src/bind/src/binding.cpp:1:
/home/zzm/software/emsdk/fastcomp/emscripten/system/include/emscripten/bind.h:1391:13: error: implicit instantiation of undefined template 'emscripten::internal::RegisterClassConstructor<int>'
            invoker::template invoke<ClassType, Policies...>(callable);
            ^
/home/zzm/projects/webml-polyfill/src/nn/wasm/src/bind/src/binding.cpp:387:6: note: in instantiation of function template specialization 'emscripten::class_<tflite::RuntimeShape,
      emscripten::internal::NoBaseClass>::constructor<int, (lambda at /home/zzm/projects/webml-polyfill/src/nn/wasm/src/bind/src/binding.cpp:387:23)>' requested here
    .constructor<int>([](int dimensions_count) {
     ^
/home/zzm/software/emsdk/fastcomp/emscripten/system/include/emscripten/bind.h:1144:16: note: template is declared here
        struct RegisterClassConstructor;
               ^
/home/zzm/software/emsdk/fastcomp/emscripten/system/include/emscripten/bind.h:1391:31: error: no member named 'invoke' in 'emscripten::class_<tflite::RuntimeShape,
      emscripten::internal::NoBaseClass>'
            invoker::template invoke<ClassType, Policies...>(callable);
                              ^

I have tested with different version, the bind code works well on version with 1.38.40 but failed with 1.38.41. According to the source code, I found it may caused by the rewrite of emscripten::class_::constructor in this commit. So how should I modify my code to fix the bug?

Thanks.

@stale
Copy link

stale bot commented Nov 6, 2020

This issue has been automatically marked as stale because there has been no activity in the past year. It will be closed automatically if no further activity occurs in the next 30 days. Feel free to re-open at any time if this issue is still relevant.

@stale stale bot added the wontfix label Nov 6, 2020
@aminya
Copy link
Contributor

aminya commented Dec 5, 2020

Related to #11274

@stale stale bot removed the wontfix label Dec 5, 2020
@aminya aminya linked a pull request Dec 5, 2020 that will close this issue
@stale
Copy link

stale bot commented Apr 17, 2022

This issue has been automatically marked as stale because there has been no activity in the past year. It will be closed automatically if no further activity occurs in the next 30 days. Feel free to re-open at any time if this issue is still relevant.

@stale stale bot added the wontfix label Apr 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants