Skip to content

Commit cd8d6ae

Browse files
committed
[API-Compat] Updated ForbidKeywordsDecorator
1 parent 3081556 commit cd8d6ae

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
@@ -247,32 +247,6 @@ def wrapper(*args: _InputT.args, **kwargs: _InputT.kwargs) -> _RetT:
247247
return decorator
248248

249249

250-
# *size => shape decorator
251-
class SizeArgsDecorator(DecoratorBase):
252-
"""
253-
Usage Example:
254-
255-
paddle.ones(1, dtype=paddle.float32)
256-
paddle.ones(1, 2, 3, dtype=paddle.float32)
257-
paddle.ones([1, 2, 3], dtype=paddle.float32)
258-
paddle.ones(size=[1, 2, 3], dtype=paddle.float32)
259-
260-
paddle.ones([1, 2, 3], paddle.float32)
261-
paddle.ones(shape=[1, 2, 3], dtype=paddle.float32)
262-
"""
263-
264-
def process(
265-
self, args: tuple[Any, ...], kwargs: dict[str, Any]
266-
) -> tuple[tuple[Any, ...], dict[str, Any]]:
267-
if 'size' in kwargs:
268-
kwargs['shape'] = kwargs.pop('size')
269-
elif len(args) >= 1 and isinstance(args[0], int):
270-
kwargs['shape'] = list(args)
271-
args = ()
272-
273-
return args, kwargs
274-
275-
276250
class VariableArgsDecorator(DecoratorBase):
277251
def __init__(self, var: str) -> None:
278252
super().__init__()

0 commit comments

Comments
 (0)