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

prototype of kornia.set_backend #6

Open
wants to merge 1 commit into
base: set-backend
Choose a base branch
from

Conversation

Sam-Armstrong
Copy link

@hmahmood24 @YushaArif99 from Edgar's latest comment on the merged kornia PR about kornia.set_backend, do we think something like this would work? Of course we'd have to make some changes to the tracer-transpiler to accommodate this functionality, but can you see any issues with it fundamentally?


# TODO: unwrap and re-wrap the kornia module if, say, it's already converted to jax and the user wants to convert it to tensorflow
# TODO: ensure that torch -> torch works fine by returning the existing module
# TODO: ensure that framework -> torch works fine by unwrapping the existing module

Choose a reason for hiding this comment

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

what does this point refer to exactly? for kornia, isn't source=torch always going to be the case?

Copy link
Author

Choose a reason for hiding this comment

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

this is referring to the case that a user does something like:

import  kornia
kornia.set_backend("tensorflow")
kornia.set_backend("torch")

so in this case we'd need to just unwrap the module

Copy link

@YushaArif99 YushaArif99 left a comment

Choose a reason for hiding this comment

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

lgtm! I guess we might need to add some additional logic to accommodate for this functionality, as you mention. But there shouldn't be any fundamental limitations here in getting this implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants