You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.
As @piiswrong mentioned in another issue, if i want to call backward afterwards, i should set is_train=True. But I noticed that backward op works well with is_train=False in many example codes, such as "neural-style".
On the other hand, when i just need the output. Forward op didn't work with is_train=False and worked well with is_train =True.
I'm confused with the usage of is_train parameter.
I want to ask how is_train=True affect the output of forward Op?
Is it ok to set all is_train to True?
Anyone explaining this will be appreciated.
Thanks in advance.
The text was updated successfully, but these errors were encountered:
A guess about the design principle of is_train is that, if is_train is set to True, the intermediate results of intermediate layers will not be saved and if is_train is set to False, the intermediate results will be saved. This design principle could save memory, because forward computation doesn't need to save the intermediate results?
Is the guess right?
is_train was not related to memory saving, but will only affect some runtime behavior of operators. Currently it is mainly for things like dropout and batchnorm
As @piiswrong mentioned in another issue, if i want to call backward afterwards, i should set is_train=True. But I noticed that backward op works well with is_train=False in many example codes, such as "neural-style".
On the other hand, when i just need the output. Forward op didn't work with is_train=False and worked well with is_train =True.
I'm confused with the usage of is_train parameter.
I want to ask how is_train=True affect the output of forward Op?
Is it ok to set all is_train to True?
Anyone explaining this will be appreciated.
Thanks in advance.
The text was updated successfully, but these errors were encountered: