- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am a bit lost, with the MNIST program I added a base module to hold all of the parameters.
There is one module subroutine
module subroutine load_mnist(training_images, training_labels, &
validation_images, validation_labels, &
testing_images, testing_labels)
use Base
real, allocatable, intent(in out) :: training_images(:,:)
real, allocatable, intent(in out) :: training_labels(:)
real, allocatable, intent(in out) :: validation_images(:,:)
real, allocatable, intent(in out) :: validation_labels(:)
real, allocatable, intent(in out), optional :: testing_images(:,:)
real, allocatable, intent(in out), optional :: testing_labels(:)
!integer, parameter :: dtype = 4 ! image_size = 784
! integer, parameter :: num_training_images = 50000
! integer, parameter :: num_validation_images = 10000
! integer, parameter :: num_testing_images = 10000
that caused the previous crash I wrote about. Only in this module had I left the parameters to avoid the crash. Whilst I am waiting for a long run, I thought I would try and tidy up this problem.
I added base to the module so the integer parameters are now visible in two places, it ran perfectly with no errors, I commented out the parameters and it still runs, it is running now.
I find this interesting behaviour as it makes no sense.
Am I missing something?
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Local declarations in the module procedure hide those at the module level. This is the normal rule of host association.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page