Get samples of batch size from a real array
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real32), | intent(in), | dimension(..), target | :: | input |
Input array |
|
| integer, | intent(in) | :: | start_index |
Start and end indices |
||
| integer, | intent(in) | :: | end_index |
Start and end indices |
||
| integer, | intent(in) | :: | batch_size |
Batch size |
Pointer to sample
module function get_sample_ptr( & input, start_index, end_index, batch_size & ) result(sample_ptr) !! Get samples of batch size from a real array implicit none ! Arguments integer, intent(in) :: start_index, end_index !! Start and end indices integer, intent(in) :: batch_size !! Batch size real(real32), dimension(..), intent(in), target :: input !! Input array real(real32), pointer :: sample_ptr(:,:) !! Pointer to sample select rank(input) rank(2) sample_ptr(1:size(input(:,1)),1:end_index-start_index+1) => & input(:,start_index:end_index) rank(3) sample_ptr(1:size(input(:,:,1)),1:end_index-start_index+1) => & input(:,:,start_index:end_index) rank(4) sample_ptr(1:size(input(:,:,:,1)),1:end_index-start_index+1) => & input(:,:,:,start_index:end_index) rank(5) sample_ptr(1:size(input(:,:,:,:,1)),1:end_index-start_index+1) => & input(:,:,:,:,start_index:end_index) rank(6) sample_ptr(1:size(input(:,:,:,:,:,1)),1:end_index-start_index+1) => & input(:,:,:,:,:,start_index:end_index) rank default sample_ptr => null() end select end function get_sample_ptr