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)
| 4184 | |
| 4185 | @keras_export('keras.backend.in_test_phase') |
| 4186 | def 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 |
nothing calls this directly
no test coverage detected