Skip to content

Need a better way to switch default program #5929

@reyoung

Description

@reyoung

There are multiple program when we training a neural network using fluid API. They are:

  1. The training program(s). There could be many training programs if we training a complex model, like GAN, RL, etc.
  2. The testing program(s). Testing programs used to evaluate the accuracy or cost on test data set while training. We use an independent program while testing because there are some operators using a different equation when testing, such as dropout.

We need a better way to easily switch default program for layers in our API.

This issue will be done in two steps:

  1. remove g_main_program/g_startup_program. Use default_main_program and default_startup_program instead.
  2. Add API switch_program to change default programs.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions