@@ -257,24 +257,33 @@ def in_white_list(module, func_name):
257
257
return (module .__name__ + '.' + func_name ) in AS_NOT_INNER_FUNC_LIST
258
258
259
259
try :
260
+ print (f"---- func 1 { func } " , flush = True )
260
261
if isinstance (func , paddle .nn .Layer ):
261
262
func = func .forward
263
+ print (f"---- func 2 { func } " , flush = True )
262
264
if isinstance (
263
265
func , paddle .jit .dy2static .program_translator .StaticFunction
264
266
):
265
267
func = func .dygraph_function
268
+ print (f"---- func 3 { func } " , flush = True )
266
269
if isinstance (func , functools .partial ):
267
270
func = func .func
271
+ print (f"---- func 4 { func } " , flush = True )
268
272
if inspect .ismethod (func ):
269
273
func = func .__func__
274
+ print (f"---- func 5 { func } " , flush = True )
270
275
func_name = getattr (func , '__name__' , None )
271
276
if inspect .ismethod (func ) or inspect .isfunction (func ):
272
277
func_name = func .__qualname__
273
278
279
+ print (f"---- func 6 { func } " , flush = True )
274
280
m = inspect .getmodule (func )
281
+ print (f"---- module 7 { m } " , flush = True )
275
282
flag = m is not None and m .__name__ .startswith (PADDLE_MODULE_PREFIX )
283
+ print (f"---- flag 8 { flag } " , flush = True )
276
284
if ignore_white_list :
277
285
flag = flag and not in_white_list (m , func_name )
286
+ print (f"---- in_white_list 9 { in_white_list (m , func_name )} " , flush = True )
278
287
279
288
return flag
280
289
except Exception :
0 commit comments