@@ -247,32 +247,6 @@ def wrapper(*args: _InputT.args, **kwargs: _InputT.kwargs) -> _RetT:
247
247
return decorator
248
248
249
249
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
-
276
250
class VariableArgsDecorator (DecoratorBase ):
277
251
def __init__ (self , var : str ) -> None :
278
252
super ().__init__ ()
0 commit comments