Skip to content

assocFn -> derivativeFn everywhere except Differentiation.cpp. #27597

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 1 commit into from
Oct 10, 2019

Conversation

bgogul
Copy link
Contributor

@bgogul bgogul commented Oct 10, 2019

This PR contains refactoring changes related to https://bugs.swift.org/browse/TF-882. More PRs to come.

@bgogul
Copy link
Contributor Author

bgogul commented Oct 10, 2019

@swift-ci please test tensorflow

@bgogul bgogul requested a review from rxwei October 10, 2019 06:07
Copy link
Contributor

@rxwei rxwei left a comment

Choose a reason for hiding this comment

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

Thanks. There's also quite a lot of occurrences of "associated function". Could you replace them as well?

swift git:(tensorflow) grep -rnw . -e 'associated function'
./test/AutoDiff/generics.swift:248:// TF-697: Test generic requirements of generated AD associated function.
./include/swift/SILOptimizer/Analysis/BottomUpIPAnalysis.h:46:  /// In the following "this function" refers to the associated function.
./include/swift/AST/Types.h:3103:  /// autodiff associated function.
./include/swift/AST/Types.h:3106:  /// indices include self, the computed associated function type will return a
./include/swift/AST/Types.h:3124:  /// Given the type of an autodiff associated function, returns the
./include/swift/AST/Types.h:3128:  /// Given the type of a transposing associated function, returns the
./include/swift/AST/DiagnosticsParse.def:1600:      "expected '{' to start an associated function list", ())
./include/swift/AST/DiagnosticsParse.def:1602:      "expected ',' between operands in an associated function list", ())
./include/swift/AST/DiagnosticsParse.def:1604:      "expected '}' to start an associated function list", ())
./include/swift/AST/DiagnosticsParse.def:1608:      "expected an associated function kind attribute, e.g. '[jvp]'", ())
./include/swift/AST/ASTMangler.h:158:  // Mangle the autodiff associated function (JVP/VJP) with the given:
./include/swift/AST/AutoDiff.h:434:/// The kind of an associated function.
./include/swift/AST/AutoDiff.h:455:/// autodiff associated function.
./include/swift/AST/AutoDiff.h:526:/// Computes the correct linkage for an associated function given the linkage of
./include/swift/SIL/SILDeclRef.h:160:  /// corresponding autodiff associated function.
./include/swift/SIL/SILDeclRef.h:366:  /// autodiff associated function.
./docs/SIL.rst:5640:In raw SIL, it is optional to provide an associated function ``with`` clause.
./docs/SIL.rst:5663:Extracts the original function or an associated function from the given
./lib/SILOptimizer/Mandatory/Differentiation.cpp:8704:    // Fold associated function extractors.
./lib/SILGen/SILGen.h:151:  /// Get or create an autodiff associated function thunk for the given
./lib/SILGen/SILGen.h:152:  /// SILDeclRef, SILFunction, and associated function type.
./lib/SILGen/SILGen.h:158:  /// Get or create an autodiff associated function vtable entry thunk for the
./lib/SILGen/SILGen.h:159:  /// given SILDeclRef and associated function type.
./lib/SILGen/SILGenBuiltin.cpp:1043:  // Get the associated function.
./lib/Sema/MiscDiagnostics.cpp:2251:/// from its associated function body.
./lib/Sema/TypeCheckAttr.cpp:2753:  // Returns true if the original function and associated function candidate are
./lib/Sema/TypeCheckAttr.cpp:2755:  // associated function have different parents, or if they both have no type
./lib/Sema/TypeCheckAttr.cpp:3596:  // Get derivative kind and associated function identifier.
./lib/ParseSIL/ParseSIL.cpp:2963:      // Parse associated function values as an operand list.
./lib/ParseSIL/ParseSIL.cpp:2965:      // we can infer AD associated function types.
./lib/ParseSIL/ParseSIL.cpp:3006:                     "associated function kind"))
./lib/AST/Builtins.cpp:1038:  // of the associated function type.
./lib/AST/Builtins.cpp:1045:  // Generator for the resultant function type, i.e. the AD associated function.
./lib/AST/Attr.cpp:523:  // Print associated function names, unless they are to be omitted.
./lib/AST/AutoDiff.cpp:168:  // associated function. Return the linkage of the original function, unless
./lib/AST/AutoDiff.cpp:169:  // the associated function is not exported (i.e. differentiation is not
./lib/AST/AutoDiff.cpp:179:  // function. Make the associated function hidden.
./lib/AST/Type.cpp:4680:  // Wrap the associated function type in additional curry levels.
./lib/AST/Type.cpp:4719:  // Wrap the associated function type in additional curry levels.
./lib/SIL/SILFunctionType.cpp:153:// Returns the canonical generic signature for an autodiff associated function
./lib/SIL/SILFunctionType.cpp:154:// given an existing associated function generic signature. All differentiation
./lib/SIL/SILFunctionType.cpp:165:  // Add associated function generic signature.
./lib/SIL/SILFunctionType.cpp:205:  // Get the canonical associated function generic signature.
./lib/SIL/SILFunctionType.cpp:2337:  // determine `silFnType` by first computing the associated function type at
./lib/SIL/SILFunctionType.cpp:2340:  // function's AST type, and then computing the associated function type at the

if (Inst->hasDerivativeFunctions())
assocFns = std::make_pair(getOpValue(Inst->getJVPFunction()),
derivativeFns = std::make_pair(getOpValue(Inst->getJVPFunction()),
getOpValue(Inst->getVJPFunction()));
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
getOpValue(Inst->getVJPFunction()));
getOpValue(Inst->getVJPFunction()));

@rxwei
Copy link
Contributor

rxwei commented Oct 10, 2019

I'll merge this and address my comments in a different patch, since you are OOO today. Thanks!

@rxwei rxwei merged commit 0aee08a into swiftlang:tensorflow Oct 10, 2019
rxwei added a commit that referenced this pull request Oct 10, 2019
…7603)

`assocFn` -> `derivativeFn`
`AssocFn` -> `DerivativeFn`
`assocFunc` -> `derivativeFunc`
`AssocFunc` -> `DerivativeFunc`
`associatedFunction` -> `derivativeFunction`
`AssociatedFunction` -> `DerivativeFunction`
`autodiff associated function` -> `derivative function`
`autodiff-associated function` -> `derivative function`
`AD associated function` -> `derivative function`
`associated differentiation function` -> `derivative function`

This is a follow-up to #27597.

Resolves [TF-882](https://bugs.swift.org/browse/TF-882).
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.

2 participants