Skip to content

Latest commit

 

History

History
54 lines (36 loc) · 1.62 KB

File metadata and controls

54 lines (36 loc) · 1.62 KB

tfra.dynamic_embedding.ModelMode

View source on GitHub




Class ModelMode

The global config of model modes.

TrainableWrapper.read_value is not thread-safe that causes threads competition and Out-Of-Bound exception in concurrent serving scenario.

To resolve this, we define the ModelMode APIs to instruct the TrainableWrapper to build a different thread-safe sub-graph for 'TrainableWrapper.read_value' on inference mode.

NOTE These APIs should be called before any graph are built.

The following standard modes are defined:

  • TRAIN: training/fitting mode.
  • INFERENCE: prediction/inference mode.

Class Members

  • CURRENT_SETTING = 'train'
  • INFERENCE = 'inference'
  • TRAIN = 'train'