Skip to content

[AutoDiff] add some @derivative(of:) tests #28785

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

Merged
merged 2 commits into from
Dec 18, 2019

Conversation

marcrasi
Copy link

Explicit tests for all the bugs fixed in #28762.

@marcrasi marcrasi requested a review from dan-zheng December 13, 2019 22:33
@marcrasi
Copy link
Author

@swift-ci please test tensorflow

@@ -0,0 +1,27 @@
// RUN: %empty-directory(%t)
Copy link
Contributor

Choose a reason for hiding this comment

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

Note: #28781 added a a file of the same name (test/AutoDiff/Serialization/derivative_attr.swift) to master branch. It covers the functionality added in this test: @derivative attribute serialization for init and subscript.


So far, AutoDiff tests on master branch and tensorflow branch have been kept separate:

  • master branch tests are all categorized in test/AutoDiff/XXX subdirectories, like test/AutoDiff/Parse.
  • tensorflow branch tests exist in test/AutoDiff at the top-level. Some multi-file tests include files in test/AutoDiff/Inputs and/or their own subdirectories, like test/AutoDiff/silgen_thunking/main.swift and swift/test/AutoDiff/Inputs/silgen_thunking_other_module.swift.

I think separation is nice because it makes it clear which tests have been upstreamed and prevents merge conflicts.

How about moving all non-upstreamed tensorflow branch tests to a test/AutoDiff/tensorflow subdirectory? cc @rxwei @bgogul

As AutoDiff code is upstreamed, tests can be polished and moved to test/AutoDiff/xxx, so eventually test/AutoDiff/tensorflow becomes empty. On tensorflow branch, tests should never be added to test/AutoDiff outside of test/AutoDiff/tensorflow. On master branch, test/AutoDiff/tensorflow does not exist and tests should be added to test/AutoDiff/XXX.

I'm happy to start this after this PR is merged!

Copy link
Contributor

Choose a reason for hiding this comment

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

A separate folder sounds good, but perhaps instead put upstreamed ones in test/AutoDiff/upstreamed/?

@marcrasi marcrasi merged commit d8df472 into swiftlang:tensorflow Dec 18, 2019
@marcrasi marcrasi deleted the retrodiff-followup-tests branch December 18, 2019 19:35
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.

3 participants