Skip to content

Commit 2cc9ebf

Browse files
committed
Add set_learning_phase in TF backend.
1 parent cb5d69c commit 2cc9ebf

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

keras/backend/tensorflow_backend.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ def learning_phase():
2121
return _LEARNING_PHASE
2222

2323

24+
def set_learning_phase(value):
25+
global _LEARNING_PHASE
26+
_LEARNING_PHASE = tf.constant(value, name='keras_learning_phase')
27+
28+
2429
def get_session():
2530
'''Returns the TF session in use by the backend.
2631
'''

0 commit comments

Comments
 (0)