4392d120d845adf25d96d353df1513aa8e1df0ad,tests/test_loss_weighting.py,,test_class_weight_wrong_classes,#,152

Before Change


    (x_train, y_train), (x_test, y_test), (sample_weight, class_weight, test_ids) = _get_test_data()

    del class_weight[1]
    try:
        model.fit(x_train, y_train, epochs=0, verbose=0, class_weight=class_weight)
        assert False
    except ValueError:
        pass  // expected behavior is to raise a ValueError with a suitable message


if __name__ == "__main__":
    pytest.main([__file__])

After Change


    (x_train, y_train), (x_test, y_test), (sample_weight, class_weight, test_ids) = _get_test_data()

    del class_weight[1]
    with pytest.raises(ValueError):
        model.fit(x_train, y_train,
                  epochs=0, verbose=0, class_weight=class_weight)


if __name__ == "__main__":
    pytest.main([__file__])
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: keras-team/keras
Commit Name: 4392d120d845adf25d96d353df1513aa8e1df0ad
Time: 2017-07-06
Author: francois.chollet@gmail.com
File Name: tests/test_loss_weighting.py
Class Name:
Method Name: test_class_weight_wrong_classes


Project Name: williamFalcon/pytorch-lightning
Commit Name: 29bcf309848b9c5ff95ab0d6dd0f12b7ae28f9b4
Time: 2021-01-12
Author: rohitgr1998@gmail.com
File Name: tests/core/test_lightning_module.py
Class Name:
Method Name: test_automatic_optimization


Project Name: keras-team/keras
Commit Name: 5e88f9034eb031f7eff58b9288b060ff748d49a6
Time: 2017-07-31
Author: me@taehoonlee.com
File Name: tests/keras/backend/backend_test.py
Class Name: TestBackend
Method Name: test_is_keras_tensor