def _test_sequential_model_type(f, test_or_class, *args, **kwargs): with testing_utils.model_type_scope('sequential'): f(test_or_class, *args, **kwargs)
def context_managers(self, kwargs): model_type = kwargs.pop('model_type', None) if model_type in KERAS_MODEL_TYPES: return [testing_utils.model_type_scope(model_type)] else: return []
def _test_functional_model_type(f, test_or_class, *args, **kwargs): with testing_utils.model_type_scope('functional'): f(test_or_class, *args, **kwargs)
def _test_subclass_model_type(f, test_or_class, *args, **kwargs): with testing_utils.model_type_scope('subclass'): f(test_or_class, *args, **kwargs)
def run_with_model_type(self, model_type, *args, **kwargs): if model_type: with testing_utils.model_type_scope(model_type): f(self, *args, **kwargs) else: f(self, *args, **kwargs)
def _test_sequential_model_type(f, test_or_class, *args, **kwargs): with testing_utils.model_type_scope('sequential'): f(test_or_class, *args, **kwargs)
def _test_subclass_model_type(f, test_or_class, *args, **kwargs): with testing_utils.model_type_scope('subclass'): f(test_or_class, *args, **kwargs)
def _test_functional_model_type(f, test_or_class, *args, **kwargs): with testing_utils.model_type_scope('functional'): f(test_or_class, *args, **kwargs)
def decorated(self, model_type, *args, **kwargs): """A run of a single test case w/ the specified model type.""" with testing_utils.model_type_scope(model_type): f(self, *args, **kwargs)