-
Notifications
You must be signed in to change notification settings - Fork 238
refactor: comp backend #1030
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
refactor: comp backend #1030
Changes from all commits
1cd2ccc
d714b1f
4f77ab5
a5ada44
5b1dfd0
7b9c145
89fee7c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -202,11 +202,11 @@ def to_protobuf(self) -> 'NdArrayProto': | |
| return nd_proto | ||
|
|
||
| @staticmethod | ||
| def get_comp_backend() -> Type['NumpyCompBackend']: | ||
| def get_comp_backend() -> 'NumpyCompBackend': | ||
| """Return the computational backend of the tensor""" | ||
| from docarray.computation.numpy_backend import NumpyCompBackend | ||
|
|
||
| return NumpyCompBackend | ||
| return NumpyCompBackend() | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it a bit of an anti pattern to crate all of these instances if we don't really need them? would it make sense to maintain a singleton instance?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh that is a good idea actually. I support this. Lets go singleton with this.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. okay good idea
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. actually doing the singleton is not that trivial in python ... I think it adds complexity for few real advantages at the end. Only conceptual advantage. |
||
|
|
||
| def __class_getitem__(cls, item: Any, *args, **kwargs): | ||
| # see here for mypy bug: https://github.com/python/mypy/issues/14123 | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.