1dc67f374cde47a721e5fe5d9237bc2573bda2f0,keras/backend/cntk_backend.py,,in_train_phase,#Any#Any#Any#,66

Before Change


        x = x()
    if callable(alt) and isinstance(x, C.cntk_py.Function) is False:
        alt = alt()
    _LEARNING_PHASE.value = np.asarray([1])
    x._uses_learning_phase = uses_learning_phase
    return x

After Change


    if callable(alt) and isinstance(alt, C.cntk_py.Function) is False:
        alt = alt()

    if training is True:
        x._uses_learning_phase = uses_learning_phase
        return x
    else:
        result = C.element_select(training, x, alt)
        result._uses_learning_phase = uses_learning_phase
        return result


def in_test_phase(x, alt):
    global _LEARNING_PHASE
    // Similiar as in_train_phase, use element_select as workaround.
    if callable(x) and isinstance(x, C.cntk_py.Function) is False:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: keras-team/keras
Commit Name: 1dc67f374cde47a721e5fe5d9237bc2573bda2f0
Time: 2017-07-06
Author: souptc@gmail.com
File Name: keras/backend/cntk_backend.py
Class Name:
Method Name: in_train_phase


Project Name: keras-team/keras
Commit Name: 1dc67f374cde47a721e5fe5d9237bc2573bda2f0
Time: 2017-07-06
Author: souptc@gmail.com
File Name: keras/backend/cntk_backend.py
Class Name:
Method Name: in_test_phase


Project Name: maxpumperla/elephas
Commit Name: d19a9299aeb39b531b8b62f5f982765a5dc54711
Time: 2021-01-31
Author: danielenricocahall@gmail.com
File Name: elephas/ml_model.py
Class Name: ElephasTransformer
Method Name: _transform