From f99e306545e073f4fb7f230fb2c8f30d93d1447c Mon Sep 17 00:00:00 2001 From: Dan Zheng Date: Tue, 12 Nov 2019 09:28:31 -0800 Subject: [PATCH] [AutoDiff upstream] Update `@differentiable` syntax. Clean up unused syntax components and fix description strings. --- utils/gyb_syntax_support/AttributeNodes.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/utils/gyb_syntax_support/AttributeNodes.py b/utils/gyb_syntax_support/AttributeNodes.py index fcc2f459a2a8b..987eacabe44af 100644 --- a/utils/gyb_syntax_support/AttributeNodes.py +++ b/utils/gyb_syntax_support/AttributeNodes.py @@ -210,7 +210,7 @@ # specifiers appear only once, in order. Node('DifferentiableAttributeArguments', kind='Syntax', description=''' - The arguments for the `@differentiable` attribute: an optional \ + The arguments for the `@differentiable` attribute: an optional differentiation parameter list and associated functions. ''', children=[ @@ -220,10 +220,6 @@ The comma following the differentiation parameters clause, if it exists. ''', is_optional=True), - Child('MaybePrimal', kind='DifferentiableAttributeFuncSpecifier', - is_optional=True), - Child('MaybeAdjoint', kind='DifferentiableAttributeFuncSpecifier', - is_optional=True), Child('MaybeJVP', kind='DifferentiableAttributeFuncSpecifier', is_optional=True), Child('MaybeVJP', kind='DifferentiableAttributeFuncSpecifier', @@ -267,7 +263,7 @@ # differentiation-param -> ('self' | identifer) ','? Node('DifferentiationParam', kind='Syntax', description=''' - A differentiation parameter: either the "self" identifier or a \ + A differentiation parameter: either the "self" identifier or a function parameter name. ''', traits=['WithTrailingComma'], @@ -284,7 +280,7 @@ # ('jvp' | 'vjp') ':' func-decl-name ','? Node('DifferentiableAttributeFuncSpecifier', kind='Syntax', description=''' - A function specifier, consisting of an identifier, colon, and a \ + A function specifier, consisting of an identifier, colon, and a function declaration name (e.g. `vjp: foo(_:_:)`). ''', traits=['WithTrailingComma'], @@ -314,7 +310,7 @@ ]), Child('Arguments', kind='DeclNameArguments', is_optional=True, description=''' - The argument labels of the referenced function, optionally \ + The argument labels of the referenced function, optionally specified. '''), ]),