• 0
    [Dy2stat]Allow users to switch eval/train mode when using @to_static to... · eed736dc
    0x45f 提交于
    [Dy2stat]Allow users to switch eval/train mode when using @to_static to decorate a function (#37383) (#37432)
    
    本PR之前使用@to_static装饰一个单独的function时,对于生成的Program无法切换train/eval模式,只能运行在train模式下。这也就导致动转静后用户多次调用function显存会一直增长。
    本PR之后,使用@to_static装饰一个单独的function时,可以通过function.train()或者function.eval()的方式来切换train/eval模式。
    eed736dc
program_translator.py 42.7 KB