Skip to content

Commit 71a73e4

Browse files
committed
Rename "associated differentiation function".
1 parent ee36b2f commit 71a73e4

File tree

3 files changed

+10
-12
lines changed

3 files changed

+10
-12
lines changed

docs/SIL.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5623,10 +5623,9 @@ differentiable_function
56235623
differentiable_function [wrt 0] %0 : $(T) -> T \
56245624
with {%1 : $(T) -> (T, (T) -> T), %2 : $(T) -> (T, (T) -> T)}
56255625

5626-
Bundles a function with its associated differentiation functions into a
5627-
``@differentiable`` function. There are two derivative functions:
5628-
a Jacobian-vector products (JVP) function and a vector-Jacobian products (VJP)
5629-
function.
5626+
Bundles a function with its derivative functions into a ``@differentiable``
5627+
function. There are two derivative functions: a Jacobian-vector products (JVP)
5628+
function and a vector-Jacobian products (VJP) function.
56305629

56315630
``[wrt ...]`` specifies parameter indices that the original function is
56325631
differentiable with respect to. When not specified, it defaults to all

include/swift/AST/DiagnosticsSema.def

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2859,8 +2859,7 @@ ERROR(implements_attr_protocol_not_conformed_to,none,
28592859
ERROR(differentiable_attr_void_result,none,
28602860
"cannot differentiate void function %0", (DeclName))
28612861
ERROR(differentiable_attr_associated_function_protocol,none,
2862-
"cannot specify associated differentiation function on protocol "
2863-
"requirement", ())
2862+
"cannot specify derivative functions on protocol requirements", ())
28642863
ERROR(differentiable_attr_overload_not_found,none,
28652864
"%0 does not have expected type %1", (DeclName, Type))
28662865
ERROR(differentiable_attr_no_currying,none,
@@ -2874,17 +2873,17 @@ NOTE(differentiable_attr_duplicate_note,none,
28742873
ERROR(differentiable_attr_function_not_same_type_context,none,
28752874
"%0 is not defined in the current type context", (DeclName))
28762875
ERROR(differentiable_attr_specified_not_function,none,
2877-
"%0 is not a function to be used as associated differentiation function",
2876+
"%0 is not a function to be used as derivative function",
28782877
(DeclName))
28792878
ERROR(differentiable_attr_class_derivative_not_final,none,
28802879
"class member derivative must be final", ())
28812880
ERROR(differentiable_attr_ambiguous_function_identifier,none,
28822881
"ambiguous or overloaded identifier %0 cannot be used in '@differentiable' "
28832882
"attribute", (DeclName))
28842883
ERROR(differentiable_attr_invalid_access,none,
2885-
"associated differentiation function %0 is required to either be public "
2886-
"or @usableFromInline because the original function %1 is public or "
2887-
"@usableFromInline", (DeclName, DeclName))
2884+
"deriavtive function %0 is required to either be public or "
2885+
"'@usableFromInline' because the original function %1 is public or "
2886+
"'@usableFromInline'", (DeclName, DeclName))
28882887
ERROR(differentiable_attr_result_not_differentiable,none,
28892888
"can only differentiate functions with results that conform to "
28902889
"'Differentiable', but %0 does not conform to 'Differentiable'", (Type))

include/swift/SIL/SILInstruction.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7846,8 +7846,8 @@ class TryApplyInst final
78467846

78477847
// SWIFT_ENABLE_TENSORFLOW
78487848
/// `differentiable_function` - given a function and differentiation indices and
7849-
/// its associated differentiation functions, create an `@differentiable`
7850-
/// function that represents a bundle of these functions and configurations.
7849+
/// its derivative functions, create an `@differentiable` function that
7850+
/// represents a bundle of these functions and configurations.
78517851
class DifferentiableFunctionInst final :
78527852
public InstructionBaseWithTrailingOperands<
78537853
SILInstructionKind::DifferentiableFunctionInst,

0 commit comments

Comments
 (0)