From e9db293561d42c440e513ad6c5d2b297189b695e Mon Sep 17 00:00:00 2001 From: melt Date: Wed, 19 Jun 2024 12:44:47 +0100 Subject: [PATCH] add temporary fix to example 1 I am debugging issue with windows user. I noticed the latest version of ifx/ifort builds with a different integer type which leads to error: ``` error #6284: There is no matching specific function for this generic function reference. [TORCH_TENSOR_FROM_ARRAY] in_tensors(1) = torch_tensor_from_array(in_data, tensor_layout, torch_kCPU) -------------------^ ``` This can be removed by forcing the integer type to int64 --- examples/1_SimpleNet/simplenet_infer_fortran.f90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/1_SimpleNet/simplenet_infer_fortran.f90 b/examples/1_SimpleNet/simplenet_infer_fortran.f90 index f08f178b..7255442b 100644 --- a/examples/1_SimpleNet/simplenet_infer_fortran.f90 +++ b/examples/1_SimpleNet/simplenet_infer_fortran.f90 @@ -1,7 +1,7 @@ program inference ! Import precision info from iso - use, intrinsic :: iso_fortran_env, only : sp => real32 + use, intrinsic :: iso_fortran_env, only : sp => real32, int64 ! Import our library for interfacing with PyTorch use ftorch @@ -18,7 +18,7 @@ program inference real(wp), dimension(5), target :: in_data real(wp), dimension(5), target :: out_data integer, parameter :: n_inputs = 1 - integer :: tensor_layout(1) = [1] + integer(int64) :: tensor_layout(1) = [1] ! Set up Torch data structures ! The net, a vector of input tensors (in this case we only have one), and the output tensor