def test_config():
    mcm_obj = MultiLabelConfusionMatrix(num_classes=3)
    assert mcm_obj.num_classes == 3
    assert mcm_obj.dtype == tf.float32
    # Check save and restore config
    mcm_obj2 = MultiLabelConfusionMatrix.from_config(mcm_obj.get_config())
    assert mcm_obj2.num_classes == 3
    assert mcm_obj2.dtype == tf.float32
Exemple #2
0
 def test_config(self):
     mcm_obj = MultiLabelConfusionMatrix(num_classes=3)
     self.assertEqual(mcm_obj.num_classes, 3)
     self.assertEqual(mcm_obj.dtype, tf.int32)
     # Check save and restore config
     mcm_obj2 = MultiLabelConfusionMatrix.from_config(mcm_obj.get_config())
     self.assertEqual(mcm_obj2.num_classes, 3)
     self.assertEqual(mcm_obj2.dtype, tf.int32)