STT-tensorflow/tensorflow/python/keras/tests
Tomer Kaftan aac1dd5788 Updates Keras layer __call__ to always set training, with the following priority order:
# Training mode for `Layer.__call__` is set via (in order of priority):
    # (1) The `training` argument passed to this `Layer.__call__`, if it is not None
    # (2) The training mode of an outer `Layer.__call__`.
    # (3) The default mode set by `tf.keras.backed.set_learning_phase` (if set).
    # (4) Any non-None default value for `training` specified in the `call`
    #  signature
    # (5) False (treating the layer as if it's in inference)

Previously (4) and (5) were missing, leading to crashes for layers that do not provide a default argument for `training`.

Note that (4) is fragile to reflection issues, and may get confused by decorators.

PiperOrigin-RevId: 317709904
Change-Id: I58039a4d9e5106bcb27f4cfbf65e6762f1b40807
2020-06-22 13:13:46 -07:00
..
add_loss_correctness_test.py Removing identity backtracking from entropy losses. 2020-06-17 13:47:34 -07:00
automatic_outside_compilation_test.py Add tests for automatic outside compilation on TPUs with Keras models. 2020-06-12 15:27:17 -07:00
BUILD Move the serialization_test to keras/tests 2020-06-16 09:35:18 -07:00
convert_to_constants_test.py Move keras related convert_to_constants_test to keras/tests. 2020-04-11 14:07:11 -07:00
custom_training_loop_test.py Updates Keras layer __call__ to always set training, with the following priority order: 2020-06-22 13:13:46 -07:00
eager_benchmarks_test.py Move eager benchmark test to Keras/tests. 2020-04-08 11:20:05 -07:00
get_config_samples.py Add serialization backwards compatibility tests 2020-04-23 16:47:20 -07:00
get_config_test.py Add serialization backwards compatibility tests 2020-04-23 16:47:20 -07:00
graph_util_test.py Move Keras related test case in graph_util_test to keras/tests. 2020-04-11 21:01:52 -07:00
integration_test.py Remove conditional loss/graph tracing based on inputs in v2 add_update/get_updates_for API. 2020-04-21 15:08:33 -07:00
memory_checker_test.py Move keras related memory_checker_test to keras/tests. 2020-04-11 20:41:49 -07:00
memory_test.py Move keras related eager memory test to keras 2020-04-08 10:30:35 -07:00
model_architectures_test.py
model_architectures.py
model_subclassing_compiled_test.py Remove passing experimental_run_tf_function in most tests. 2020-02-27 13:34:09 -08:00
model_subclassing_test_util.py
model_subclassing_test.py Remove conditional loss/graph tracing based on inputs in v2 add_update/get_updates_for API. 2020-04-21 15:08:33 -07:00
op_callbacks_test.py Blacklist Case op from callback 2020-06-05 13:40:31 -07:00
saved_model_test.py Move keras related saved_model test to keras integration test and unit test. 2020-06-10 09:21:38 -07:00
saver_test.py Fork the keras related saver_test to keras. 2020-06-15 09:02:54 -07:00
serialization_util_test.py Move the serialization_test to keras/tests 2020-06-16 09:35:18 -07:00
summary_ops_test.py Move keras related summary_ops_test to keras/tests. 2020-04-14 19:14:05 -07:00
temporal_sample_weights_correctness_test.py Remove passing experimental_run_tf_function in most tests. 2020-02-27 13:34:09 -08:00
tracking_test.py Fork keras related tracking test to keras/tests 2020-06-15 09:38:41 -07:00
tracking_util_test.py Fork keras related tracking test to keras/tests 2020-06-15 09:38:41 -07:00
tracking_util_with_v1_optimizers_test.py Fork tracking/util_with_v1_optimizers_test to keras/tests. 2020-06-15 10:49:59 -07:00
tracking_util_xla_test.py Move tracking_util_xla_test to keras/tests 2020-06-15 13:24:58 -07:00