-
Notifications
You must be signed in to change notification settings - Fork 615
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
Add baseline stubs for Python Tensor types #5153
Conversation
ac26fe1
to
b541290
Compare
Signed-off-by: Krzysztof Lecki <klecki@nvidia.com>
Signed-off-by: Krzysztof Lecki <klecki@nvidia.com>
Signed-off-by: Krzysztof Lecki <klecki@nvidia.com>
b541290
to
c8c56cd
Compare
!build |
After the last changes, mypy declares the return types of
I am intentionally not adjusting any other imports to see if this change doesn't break anything in the existing code. |
CI MESSAGE: [10788983]: BUILD STARTED |
CI MESSAGE: [10788983]: BUILD PASSED |
the docs set the module explicitly, but still, even though we adjusted the module path, the signatures utilize the backend_impl variant. This is generated by the pybind and inserted into the docstring, I don't know if we can easily override it in the backend or maybe we should replace it when it is loaded into python. Both approaches are kinda weird. |
Providing the definition as the first element allows the downstream definitions to utilize this module in pybind-generated docstrings. Signed-off-by: Krzysztof Lecki <klecki@nvidia.com>
Signed-off-by: Krzysztof Lecki <klecki@nvidia.com>
!build |
CI MESSAGE: [10841126]: BUILD STARTED |
CI MESSAGE: [10841126]: BUILD FAILED |
!build |
CI MESSAGE: [10842296]: BUILD STARTED |
Signed-off-by: Krzysztof Lecki <klecki@nvidia.com>
!build |
CI MESSAGE: [10842605]: BUILD STARTED |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI: I did not look into the documentation as it's not built yet.
Signed-off-by: Krzysztof Lecki <klecki@nvidia.com>
!build |
CI MESSAGE: [10842605]: BUILD PASSED |
CI MESSAGE: [10845923]: BUILD STARTED |
CI MESSAGE: [10845923]: BUILD PASSED |
Category: New feature
Description:
Base for the Python Tensor and TensorList types interface files,
generated using stubgen.
C-based types (or types not guaranteed to be present, like np.array),
are removed from signatures and left as a comment or replaced with Any.
This doesn't necessary add new information, just enables static tools
to access the types.
Before:
After:
Note that the backend contains many more types, like OpSchema, OpSpec, Pipeline, etc.
They are internal, so I didn't expose them, but we should consider adding them to aid our development.
This file is generated and than manually adjusted, I don't see a clear automated workflow for this.
It appears harder to maintain than a list of supported enum values.
Additional information:
Affected modules and functionalities:
Key points relevant for the review:
Tests:
Checklist
Documentation
DALI team only
Requirements
REQ IDs: N/A
JIRA TASK: N/A