Skip to content

Commit 3db16a2

Browse files
committed
[API-Compat] Updated ForbidKeywordsDecorator
1 parent 9e1f1ad commit 3db16a2

File tree

1 file changed

+0
-26
lines changed

1 file changed

+0
-26
lines changed

python/paddle/utils/decorator_utils.py

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -220,32 +220,6 @@ def wrapper(*args: _InputT.args, **kwargs: _InputT.kwargs) -> _RetT:
220220
return decorator
221221

222222

223-
# *size => shape decorator
224-
class SizeArgsDecorator(DecoratorBase):
225-
"""
226-
Usage Example:
227-
228-
paddle.ones(1, dtype=paddle.float32)
229-
paddle.ones(1, 2, 3, dtype=paddle.float32)
230-
paddle.ones([1, 2, 3], dtype=paddle.float32)
231-
paddle.ones(size=[1, 2, 3], dtype=paddle.float32)
232-
233-
paddle.ones([1, 2, 3], paddle.float32)
234-
paddle.ones(shape=[1, 2, 3], dtype=paddle.float32)
235-
"""
236-
237-
def process(
238-
self, args: tuple[Any, ...], kwargs: dict[str, Any]
239-
) -> tuple[tuple[Any, ...], dict[str, Any]]:
240-
if 'size' in kwargs:
241-
kwargs['shape'] = kwargs.pop('size')
242-
elif len(args) >= 1 and isinstance(args[0], int):
243-
kwargs['shape'] = list(args)
244-
args = ()
245-
246-
return args, kwargs
247-
248-
249223
class VariableArgsDecorator(DecoratorBase):
250224
def __init__(self, var: str) -> None:
251225
super().__init__()

0 commit comments

Comments
 (0)