@@ -220,32 +220,6 @@ def wrapper(*args: _InputT.args, **kwargs: _InputT.kwargs) -> _RetT:
220
220
return decorator
221
221
222
222
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
-
249
223
class VariableArgsDecorator (DecoratorBase ):
250
224
def __init__ (self , var : str ) -> None :
251
225
super ().__init__ ()
0 commit comments