Skip to content

[AutoDiff] Rename 'AutoDiffIndexSubset' to 'IndexSubset'. #27615

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 6 commits into from
Oct 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions include/swift/AST/ASTContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,7 @@ namespace swift {
class TypeAliasDecl;
class VarDecl;
class UnifiedStatsReporter;
// SWIFT_ENABLE_TENSORFLOW
class AutoDiffIndexSubset;
class IndexSubset;
class VectorSpace;
class DifferentiableAttr;

Expand Down Expand Up @@ -280,8 +279,7 @@ class ASTContext final {
/// Cache of `@differentiable` attributes keyed by parameter indices. This
/// helps us diagnose multiple `@differentiable`s that are with respect to the
/// same set of parameters.
llvm::DenseMap<std::pair<Decl *, AutoDiffIndexSubset *>,
DifferentiableAttr *>
llvm::DenseMap<std::pair<Decl *, IndexSubset *>, DifferentiableAttr *>
DifferentiableAttrs;

private:
Expand Down
30 changes: 15 additions & 15 deletions include/swift/AST/Attr.h
Original file line number Diff line number Diff line change
Expand Up @@ -1552,7 +1552,7 @@ class DifferentiableAttr final
/// specified.
FuncDecl *VJPFunction = nullptr;
/// The differentiation parameters' indices, resolved by the type checker.
AutoDiffIndexSubset *ParameterIndices = nullptr;
IndexSubset *ParameterIndices = nullptr;
/// The trailing where clause (optional).
TrailingWhereClause *WhereClause = nullptr;
/// The generic signature for autodiff derivative functions. Resolved by the
Expand All @@ -1571,7 +1571,7 @@ class DifferentiableAttr final

explicit DifferentiableAttr(ASTContext &context, bool implicit,
SourceLoc atLoc, SourceRange baseRange,
bool linear, AutoDiffIndexSubset *indices,
bool linear, IndexSubset *indices,
Optional<DeclNameWithLoc> jvp,
Optional<DeclNameWithLoc> vjp,
GenericSignature *derivativeGenericSignature);
Expand All @@ -1587,7 +1587,7 @@ class DifferentiableAttr final

static DifferentiableAttr *create(ASTContext &context, bool implicit,
SourceLoc atLoc, SourceRange baseRange,
bool linear, AutoDiffIndexSubset *indices,
bool linear, IndexSubset *indices,
Optional<DeclNameWithLoc> jvp,
Optional<DeclNameWithLoc> vjp,
GenericSignature *derivativeGenSig);
Expand All @@ -1602,10 +1602,10 @@ class DifferentiableAttr final
/// registered VJP.
Optional<DeclNameWithLoc> getVJP() const { return VJP; }

AutoDiffIndexSubset *getParameterIndices() const {
IndexSubset *getParameterIndices() const {
return ParameterIndices;
}
void setParameterIndices(AutoDiffIndexSubset *pi) {
void setParameterIndices(IndexSubset *pi) {
ParameterIndices = pi;
}

Expand Down Expand Up @@ -1681,7 +1681,7 @@ class DifferentiatingAttr final
/// The number of parsed parameters specified in 'wrt:'.
unsigned NumParsedParameters = 0;
/// The differentiation parameters' indices, resolved by the type checker.
AutoDiffIndexSubset *ParameterIndices = nullptr;
IndexSubset *ParameterIndices = nullptr;

explicit DifferentiatingAttr(ASTContext &context, bool implicit,
SourceLoc atLoc, SourceRange baseRange,
Expand All @@ -1691,7 +1691,7 @@ class DifferentiatingAttr final
explicit DifferentiatingAttr(ASTContext &context, bool implicit,
SourceLoc atLoc, SourceRange baseRange,
DeclNameWithLoc original, bool linear,
AutoDiffIndexSubset *indices);
IndexSubset *indices);

public:
static DifferentiatingAttr *create(ASTContext &context, bool implicit,
Expand All @@ -1702,7 +1702,7 @@ class DifferentiatingAttr final
static DifferentiatingAttr *create(ASTContext &context, bool implicit,
SourceLoc atLoc, SourceRange baseRange,
DeclNameWithLoc original, bool linear,
AutoDiffIndexSubset *indices);
IndexSubset *indices);

DeclNameWithLoc getOriginal() const { return Original; }

Expand All @@ -1723,10 +1723,10 @@ class DifferentiatingAttr final
return NumParsedParameters;
}

AutoDiffIndexSubset *getParameterIndices() const {
IndexSubset *getParameterIndices() const {
return ParameterIndices;
}
void setParameterIndices(AutoDiffIndexSubset *pi) {
void setParameterIndices(IndexSubset *pi) {
ParameterIndices = pi;
}

Expand Down Expand Up @@ -1757,7 +1757,7 @@ class TransposingAttr final
/// The number of parsed parameters specified in 'wrt:'.
unsigned NumParsedParameters = 0;
/// The differentiation parameters' indices, resolved by the type checker.
AutoDiffIndexSubset *ParameterIndexSubset = nullptr;
IndexSubset *ParameterIndexSubset = nullptr;

explicit TransposingAttr(ASTContext &context, bool implicit,
SourceLoc atLoc, SourceRange baseRange,
Expand All @@ -1767,7 +1767,7 @@ class TransposingAttr final
explicit TransposingAttr(ASTContext &context, bool implicit,
SourceLoc atLoc, SourceRange baseRange,
TypeRepr *baseType, DeclNameWithLoc original,
AutoDiffIndexSubset *indices);
IndexSubset *indices);

public:
static TransposingAttr *create(ASTContext &context, bool implicit,
Expand All @@ -1778,7 +1778,7 @@ class TransposingAttr final
static TransposingAttr *create(ASTContext &context, bool implicit,
SourceLoc atLoc, SourceRange baseRange,
TypeRepr *baseType, DeclNameWithLoc original,
AutoDiffIndexSubset *indices);
IndexSubset *indices);

TypeRepr *getBaseType() const { return BaseType; }
DeclNameWithLoc getOriginal() const { return Original; }
Expand All @@ -1798,10 +1798,10 @@ class TransposingAttr final
return NumParsedParameters;
}

AutoDiffIndexSubset *getParameterIndexSubset() const {
IndexSubset *getParameterIndexSubset() const {
return ParameterIndexSubset;
}
void setParameterIndices(AutoDiffIndexSubset *pi) {
void setParameterIndices(IndexSubset *pi) {
ParameterIndexSubset = pi;
}

Expand Down
Loading