Skip to content

Conversation

@dan-zheng
Copy link
Contributor

Previously, @differentiable attribute type-checking used ad-hoc
differentiation parameter inference logic.

Now, that differentiation parameter inference logic has been moved to
AutoDiffParameterIndicesBuilder::inferParameters so that it can be shared
with @differentiable attribute type-checking.

Add retroactive derivative tests.

Resolves TF-363.

@dan-zheng dan-zheng requested a review from pschuh March 16, 2019 10:54
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed setAllParameters because it has no usages and is subsumed by inferParameters.

It would be possible to implement inferParameters using setAllParameters if AutoDiffParameterIndicesBuilder stored a functionType, but it doesn't.

@dan-zheng dan-zheng changed the title [AutoDiff] Share code for differentiation parameter inference. [AutoDiff] Unify code for differentiation parameter inference. Mar 16, 2019
@dan-zheng dan-zheng force-pushed the TF-363 branch 2 times, most recently from d6cbf87 to b87d54e Compare March 16, 2019 10:59
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note: conformsToDifferentiableInModule is duped in TypeCheckAttr.cpp. It could be declared in AutoDiff.h to eliminate dupe, holding off for now though.

@dan-zheng dan-zheng requested a review from rxwei March 16, 2019 11:02
Previously, `@differentiable` attribute type-checking used ad-hoc
differentiation parameter inference logic.

Now, that differentiation parameter inference logic has been moved to
`AutoDiffParameterIndicesBuilder::inferParameters` so that it can be shared
with `@differentiable` attribute type-checking.

Add retroactive derivative tests.

Resolves TF-363.
- Move tests to `test/AutoDiff/derivative_registration.swift`.
- Document differentiation parameter inference rules.
@dan-zheng
Copy link
Contributor Author

@swift-ci Please test tensorflow

@dan-zheng
Copy link
Contributor Author

@swift-ci Please test tensorflow macOS

@dan-zheng
Copy link
Contributor Author

@swift-ci Please test tensorflow linux GPU

@dan-zheng dan-zheng added the tensorflow This is for "tensorflow" branch PRs. label Mar 16, 2019
@dan-zheng dan-zheng merged commit 146f975 into swiftlang:tensorflow Mar 16, 2019
@dan-zheng dan-zheng deleted the TF-363 branch March 16, 2019 14:45
rxwei pushed a commit to rxwei/swift that referenced this pull request May 11, 2019
…lang#23350)

Previously, `@differentiable` attribute type-checking used ad-hoc
differentiation parameter inference logic.

Now, that differentiation parameter inference logic has been moved to
`AutoDiffParameterIndicesBuilder::inferParameters` so that it can be shared
with `@differentiable` attribute type-checking.

Add derivative registration tests.

Resolves TF-363.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tensorflow This is for "tensorflow" branch PRs.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants