Skip to content

Conversation

@deel77
Copy link
Contributor

@deel77 deel77 commented Sep 30, 2020

This fixes #3864

As specified in #3864 Angular is currently not working with WASM backend due to usage of custom Promise.resolve() implementation which is always wrapping object to ZoneAwarePromise (even if it already was).

Therefore check for Promise type backend using Promise.resolve(backend) === backend is always returning false.

It is only manifesting with WASM backend in Angular as both WebGL and CPU are not returned as Promise from factory.

This is fix to this problem, which is keeping previous functionality unchanged.

Optionally it can be solved by always wrapping all backends into Promise.resolve() and handling all backends in async way, but it would mean changing more function signature and all usages could be changed to handle only async way.

To see the logs from the Cloud Build CI, please join either our discussion or announcement mailing list.


This change is Reviewable

@tafsiri tafsiri requested a review from annxingyuan October 1, 2020 01:54
@annxingyuan
Copy link
Contributor

Hi @deel77 - thank you so much for this fix! Could you include a comment in the code explaining that this is a more liberal check and accounts for custom Promise implementations?

@deel77
Copy link
Contributor Author

deel77 commented Oct 1, 2020

Hi @annxingyuan, I have expanded comment to explain the change

Copy link
Contributor

@annxingyuan annxingyuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@deel77 awesome - thank you!

@annxingyuan annxingyuan merged commit 1823952 into tensorflow:master Oct 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

WASM -> TypeError: Cannot read property 'cwrap' of undefined

3 participants