Example #1
0
 def __impl__(*args, **kwargs):
     program_translator = ProgramTranslator()
     if not program_translator.enable_declarative:
         logger.info(
             "The decorator 'declarative' doesn't work when setting ProgramTranslator.enable=False. "
             "We will just return dygraph output.")
         return dygraph_func(*args, **kwargs)
     return program_translator.get_output(dygraph_func, *args, **kwargs)
Example #2
0
 def __impl__(*args, **kwargs):
     if in_dygraph_mode():
         warnings.warn(
             "The decorator 'dygraph_to_static_output' doesn't work in "
             "dygraph mode. We will just return dygraph output. Use the "
             "decorator in static mode if you would like to translate to "
             "static graph.")
         return dygraph_func(*args, **kwargs)
     program_translator = ProgramTranslator()
     return program_translator.get_output(dygraph_func, *args, **kwargs)