<s> import tensorflow as tf <EOL> from . . callbacks import Callbacks <EOL> from . . models import ModelDesc <EOL> from . . utils import * <EOL> from . . tfutils import * <EOL> from . . dataflow import DataFlow <EOL> __all__ = [ '<STR_LIT>' ] <EOL> class TrainConfig ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> def assert_type ( v , tp ) : <EOL> assert isinstance ( v , tp ) , v . __class__ <EOL> self . dataset = kwargs . pop ( '<STR_LIT>' ) <EOL> assert_type ( self . dataset , DataFlow ) <EOL> self . optimizer = kwargs . pop ( '<STR_LIT>' ) <EOL> assert_type ( self . optimizer , tf . train . Optimizer ) <EOL> self . callbacks = kwargs . pop ( '<STR_LIT>' ) <EOL> assert_type ( self . callbacks , Callbacks ) <EOL> self . model = kwargs . pop ( '<STR_LIT>' ) <EOL> assert_type ( self . model , ModelDesc ) <EOL> self . session_config = kwargs . pop ( '<STR_LIT>' , get_default_sess_config ( ) ) <EOL> assert_type ( self . session_config , tf . ConfigProto ) <EOL> self . session_init = kwargs . pop ( '<STR_LIT>' , NewSession ( ) ) <EOL> assert_type ( self . session_init , SessionInit ) <EOL> self . step_per_epoch = int ( kwargs . pop ( '<STR_LIT>' ) ) <EOL> self . starting_epoch = int ( kwargs . pop ( '<STR_LIT>' , <NUM_LIT:1> ) ) <EOL> self . max_epoch = int ( kwargs . pop ( '<STR_LIT>' , <NUM_LIT:100> ) ) <EOL> assert self . step_per_epoch > <NUM_LIT:0> and self . max_epoch > <NUM_LIT:0> <EOL> self . nr_tower = int ( kwargs . pop ( '<STR_LIT>' , <NUM_LIT:1> ) ) <EOL> assert len ( kwargs ) == <NUM_LIT:0> , '<STR_LIT>' . format ( str ( kwargs . keys ( ) ) ) </s>
