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

[SR-9465] [AD] Use a single @differentiable attribute as both a decl attr and a type attr. #51927

Closed
rxwei opened this issue Dec 10, 2018 · 6 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. swift for tensorflow

Comments

@rxwei
Copy link
Member

rxwei commented Dec 10, 2018

Previous ID SR-9465
Radar None
Original Reporter @rxwei
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Swift for TensorFlow
Labels Bug
Assignee pschuh (JIRA)
Priority Medium

md5: 6e7d713ba4071d9e1587bc61f7c06f41

relates to:

Issue Description:

Currently we use a @differentiable attribute on declarations and an @autodiff attribute on function types, because the lexer can only lex @differentiable as either a decl attr or a type attr.

@rxwei
Copy link
Member Author

rxwei commented Jan 27, 2019

pschuh (JIRA User) FYI. We'll need a solution to this soon.

@swift-ci
Copy link
Collaborator

Comment by Parker Schuh (JIRA)

Hi Richard,
Have you looked into this before? / have evidence that this requires lexer changes? I just renamed it locally in my client and it seems to "just work". Am I missing something?

@rxwei
Copy link
Member Author

rxwei commented Jan 30, 2019

When I did it in the first place it didn't work because it defaulted to the decl attribute. Could you describe what you tried a bit more?

@swift-ci
Copy link
Collaborator

Comment by Parker Schuh (JIRA)

I just added: TYPE_ATTR(differentiable) to include/swift/AST/Attr.def and it seemed to work for the unit-tests. (No confusion so far)

@rxwei
Copy link
Member Author

rxwei commented Jan 30, 2019

Q: Did you also remove `TYPE_ATTR(autodiff)`?
If so, even better! Could you start PR then?

@rxwei
Copy link
Member Author

rxwei commented Jan 31, 2019

Seems like a new merge made this easy.
Parker fixed it here #22257

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. swift for tensorflow
Projects
None yet
Development

No branches or pull requests

2 participants