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

Change TTensor etc. to be constrained | fix(typing) #769

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

justinchuby
Copy link
Collaborator

Fixes #707

@justinchuby justinchuby added module: torchlib Related to the torch/aten function lib in development topic: typing Typing related issues labels Jun 7, 2023
Copy link
Contributor

@abock abock left a comment

Choose a reason for hiding this comment

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

Since you're here, there seems to be a lot of repetition of groups of primitive tensor types that should compose more cleanly. I suggested one inline as an example, but I think it's worth auditing the rest.

INT64,
UINT8,
)
TTensorOrString = TypeVar(
Copy link
Contributor

Choose a reason for hiding this comment

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

TTensorOrString = TypeVar("TTensorOrString", TTensor, STRING)

"TRealUnlessFloat16OrInt8", bound=Union[DOUBLE, FLOAT, INT16, INT32, INT64]
"TRealUnlessFloat16OrInt8", DOUBLE, FLOAT, INT16, INT32, INT64
)
TrealOrUInt8 = TypeVar(
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: Letter-case seems non-uniform. Change to TRealOrUInt8 ?

@gramalingam
Copy link
Collaborator

Is there any concern with this PR?

@justinchuby
Copy link
Collaborator Author

So some tests failed but I didn’t get a chance to look at them yet

@justinchuby justinchuby marked this pull request as draft August 28, 2023 21:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: torchlib Related to the torch/aten function lib in development topic: typing Typing related issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Change TTensor etc. to be constrained
4 participants