File tree Expand file tree Collapse file tree 6 files changed +16
-14
lines changed Expand file tree Collapse file tree 6 files changed +16
-14
lines changed Original file line number Diff line number Diff line change @@ -106,7 +106,7 @@ string(REGEX REPLACE "^ | $" "" LIBS "${LIBS}")
106106
107107# tests
108108enable_testing ()
109- foreach (execid input1d_layer input3d_layer dense_layer conv2d_layer maxpool2d_layer flatten_layer dense_network conv2d_network)
109+ foreach (execid input1d_layer input3d_layer dense_layer conv2d_layer maxpool2d_layer flatten_layer dense_network conv2d_network keras_read_model )
110110 add_executable (test_${execid} test /test_${execid} .f90)
111111 target_link_libraries (test_${execid} neural ${LIBS} )
112112 add_test (test_${execid} bin/test_${execid} )
Original file line number Diff line number Diff line change @@ -5,11 +5,11 @@ module nf_io_hdf5
55 implicit none
66
77 private
8- public :: get_h5_attribute_string
8+ public :: get_hdf5_attribute_string
99
1010 interface
1111
12- module function get_h5_attribute_string ( &
12+ module function get_hdf5_attribute_string ( &
1313 filename , object_name , attribute_name ) result(res)
1414 character (* ), intent (in ) :: filename
1515 ! ! HDF5 file name
@@ -18,7 +18,7 @@ module function get_h5_attribute_string( &
1818 character (* ), intent (in ) :: attribute_name
1919 ! ! Name of the attribute to read
2020 character (:), allocatable :: res
21- end function get_h5_attribute_string
21+ end function get_hdf5_attribute_string
2222
2323 end interface
2424
Original file line number Diff line number Diff line change 99
1010contains
1111
12- module function get_h5_attribute_string ( &
12+ module function get_hdf5_attribute_string ( &
1313 filename , object_name , attribute_name ) result(res)
1414
1515 character (* ), intent (in ) :: filename
@@ -41,6 +41,6 @@ module function get_h5_attribute_string( &
4141
4242 res = string (:index (string, c_null_char) - 1 )
4343
44- end function get_h5_attribute_string
44+ end function get_hdf5_attribute_string
4545
4646end submodule nf_io_hdf5_submodule
Original file line number Diff line number Diff line change 11submodule(nf_keras) nf_keras_submodule
22
33 use json_module, only: json_core, json_value
4- use nf_io_hdf5, only: get_h5_attribute_string
4+ use nf_io_hdf5, only: get_hdf5_attribute_string
55
66 implicit none
77
@@ -21,7 +21,9 @@ module function get_keras_h5_layers(filename) result(res)
2121 integer :: n, num_layers, num_elements
2222 logical :: found
2323
24- model_config_string = get_h5_attribute_string(filename, ' .' , ' model_config' )
24+ model_config_string = get_hdf5_attribute_string( &
25+ filename, ' .' , ' model_config' &
26+ )
2527
2628 call json % parse(model_config_json, model_config_string)
2729 call json % get(model_config_json, ' config.layers' , layers_json)
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ program test_io_hdf5
22
33 use iso_fortran_env, only: stderr = > error_unit
44 use nf_datasets, only: download_and_unpack, keras_model_dense_mnist_url
5- use nf_io_hdf5, only: get_h5_attribute_string
5+ use nf_io_hdf5, only: get_hdf5_attribute_string
66
77 implicit none
88
@@ -14,7 +14,7 @@ program test_io_hdf5
1414 inquire (file= test_data_path, exist= file_exists)
1515 if (.not. file_exists) call download_and_unpack(keras_model_dense_mnist_url)
1616
17- attr = get_h5_attribute_string (test_data_path, ' .' , ' backend' )
17+ attr = get_hdf5_attribute_string (test_data_path, ' .' , ' backend' )
1818
1919 if (.not. attr == ' tensorflow' ) then
2020 ok = .false.
Original file line number Diff line number Diff line change 1- program test_parse_keras_model
1+ program test_keras_read_model
22
33 use iso_fortran_env, only: stderr = > error_unit
44 use nf_datasets, only: download_and_unpack, keras_model_dense_mnist_url
@@ -52,10 +52,10 @@ program test_parse_keras_model
5252 end if
5353
5454 if (ok) then
55- print ' (a)' , ' test_parse_keras_model : All tests passed.'
55+ print ' (a)' , ' test_keras_read_model : All tests passed.'
5656 else
57- write (stderr, ' (a)' ) ' test_parse_keras_model : One or more tests failed.'
57+ write (stderr, ' (a)' ) ' test_keras_read_model : One or more tests failed.'
5858 stop 1
5959 end if
6060
61- end program test_parse_keras_model
61+ end program test_keras_read_model
You can’t perform that action at this time.
0 commit comments