Skip to content

Commit b94c097

Browse files
committed
Clarify @derivative(of:) and @transpose(of:) attribute names.
1 parent c842fee commit b94c097

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

include/swift/AST/Attr.h

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1765,19 +1765,19 @@ class DifferentiableAttr final
17651765
}
17661766
};
17671767

1768-
/// The `@derivative` attribute registers a function as a derivative of another
1769-
/// function-like declaration: a 'func', 'init', 'subscript', or 'var' computed
1770-
/// property declaration.
1768+
/// The `@derivative(of:)` attribute registers a function as a derivative of
1769+
/// another function-like declaration: a 'func', 'init', 'subscript', or 'var'
1770+
/// computed property declaration.
17711771
///
1772-
/// The `@derivative` attribute also has an optional `wrt:` clause specifying
1773-
/// the parameters that are differentiated "with respect to", i.e. the
1774-
/// differentiation parameters. The differentiation parameters must conform to
1775-
/// the `Differentiable` protocol.
1772+
/// The `@derivative(of:)` attribute also has an optional `wrt:` clause
1773+
/// specifying the parameters that are differentiated "with respect to", i.e.
1774+
/// the differentiation parameters. The differentiation parameters must conform
1775+
/// to the `Differentiable` protocol.
17761776
///
17771777
/// If the `wrt:` clause is unspecified, the differentiation parameters are
17781778
/// inferred to be all parameters that conform to `Differentiable`.
17791779
///
1780-
/// `@derivative` attribute type-checking verifies that the type of the
1780+
/// `@derivative(of:)` attribute type-checking verifies that the type of the
17811781
/// derivative function declaration is consistent with the type of the
17821782
/// referenced original declaration and the differentiation parameters.
17831783
///
@@ -1858,17 +1858,17 @@ class DerivativeAttr final
18581858
}
18591859
};
18601860

1861-
/// The `@transpose` attribute registers a function as a transpose of another
1862-
/// function-like declaration: a 'func', 'init', 'subscript', or 'var' computed
1863-
/// property declaration.
1861+
/// The `@transpose(of:)` attribute registers a function as a transpose of
1862+
/// another function-like declaration: a 'func', 'init', 'subscript', or 'var'
1863+
/// computed property declaration.
18641864
///
1865-
/// The `@transpose` attribute also has a `wrt:` clause specifying the
1865+
/// The `@transpose(of:)` attribute also has a `wrt:` clause specifying the
18661866
/// parameters that are transposed "with respect to", i.e. the transposed
18671867
/// parameters.
18681868
///
18691869
/// Examples:
18701870
/// @transpose(of: foo)
1871-
/// @transpose(of: +, wrt: (lhs, rhs))
1871+
/// @transpose(of: +, wrt: (0, 1))
18721872
class TransposeAttr final
18731873
: public DeclAttribute,
18741874
private llvm::TrailingObjects<TransposeAttr, ParsedAutoDiffParameter> {

0 commit comments

Comments
 (0)