MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / in_test_phase

Function in_test_phase

tensorflow/python/keras/backend.py:4186–4203  ·  view source on GitHub ↗

Selects `x` in test phase, and `alt` otherwise. Note that `alt` should have the *same shape* as `x`. Arguments: x: What to return in test phase (tensor or callable that returns a tensor). alt: What to return otherwise (tensor or callable that returns a tensor).

(x, alt, training=None)

Source from the content-addressed store, hash-verified

4184
4185@keras_export('keras.backend.in_test_phase')
4186def in_test_phase(x, alt, training=None):
4187 """Selects `x` in test phase, and `alt` otherwise.
4188
4189 Note that `alt` should have the *same shape* as `x`.
4190
4191 Arguments:
4192 x: What to return in test phase
4193 (tensor or callable that returns a tensor).
4194 alt: What to return otherwise
4195 (tensor or callable that returns a tensor).
4196 training: Optional scalar tensor
4197 (or Python boolean, or Python integer)
4198 specifying the learning phase.
4199
4200 Returns:
4201 Either `x` or `alt` based on `K.learning_phase`.
4202 """
4203 return in_train_phase(alt, x, training=training)
4204
4205
4206# NN OPERATIONS

Callers

nothing calls this directly

Calls 1

in_train_phaseFunction · 0.85

Tested by

no test coverage detected