MCPcopy Create free account
hub / github.com/PaddlePaddle/Paddle / wrapped_func

Function wrapped_func

python/paddle/utils/decorator_utils.py:340–350  ·  view source on GitHub ↗
(*args: Any, **kwargs: Any)

Source from the content-addressed store, hash-verified

338
339 @functools.wraps(func)
340 def wrapped_func(*args: Any, **kwargs: Any) -> Any:
341 if 'size' in kwargs:
342 kwargs['shape'] = kwargs.pop('size')
343 elif len(args) >= 1 and isinstance(args[0], int):
344 kwargs['shape'] = list(args)
345 args = ()
346
347 if 'shape' in kwargs and isinstance(kwargs['shape'], int):
348 kwargs['shape'] = [kwargs['shape']]
349
350 return func(*args, **kwargs)
351
352 wrapped_func.__signature__ = inspect.signature(func)
353

Callers 1

test_local_mapMethod · 0.85

Calls 3

listFunction · 0.85
funcFunction · 0.50
popMethod · 0.45

Tested by 1

test_local_mapMethod · 0.68