From 1c83c03bc613fe42aac26fa5b549bbab65901989 Mon Sep 17 00:00:00 2001 From: augustin64 Date: Wed, 1 Feb 2023 21:15:54 +0100 Subject: [PATCH] Update test/cnn_utils.c --- test/cnn_utils.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/test/cnn_utils.c b/test/cnn_utils.c index 2bc7c04..2ba3fae 100644 --- a/test/cnn_utils.c +++ b/test/cnn_utils.c @@ -10,9 +10,10 @@ int main() { printf("Création du réseau\n"); Network* network = create_network_lenet5(0, 0, 3, 2, 32, 1); + Network* network2 = create_network_lenet5(0, 0, 3, 2, 32, 1); printf(GREEN "OK\n" RESET); - printf("Copie du réseau\n"); + printf("Copie du réseau via copy_network\n"); Network* network_cp = copy_network(network); printf(GREEN "OK\n" RESET); @@ -23,7 +24,19 @@ int main() { } printf(GREEN "OK\n" RESET); + printf("Copie du réseau via copy_network_parameters\n"); + copy_network_parameters(network, network2); + printf(GREEN "OK\n" RESET); + + printf("Vérification de l'égalité des réseaux\n"); + if (! equals_networks(network, network2)) { + printf_error(RED "Les deux réseaux obtenus ne sont pas égaux.\n" RESET); + exit(1); + } + printf(GREEN "OK\n" RESET); + free_network(network_cp); + free_network(network2); free_network(network); return 0; } \ No newline at end of file