Skip to content

Commit cdd4433

Browse files
committed
Merge fixes
1 parent 5881a3b commit cdd4433

File tree

4 files changed

+27
-27
lines changed

4 files changed

+27
-27
lines changed

examples/5_Autograd/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,5 @@ if(CMAKE_BUILD_TESTS)
3333
COMMAND autograd
3434
WORKING_DIRECTORY ${PROJECT_BINARY_DIR})
3535
set_tests_properties(fautograd PROPERTIES PASS_REGULAR_EXPRESSION
36-
"-12.00000000 65.00000000")
36+
"-12.0000000 65.0000000")
3737
endif()

examples/5_Autograd/autograd.f90

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ program example
3535
Q = 3 * a ** 3 - b ** 2
3636

3737
! Extract output Fortran array from Q tensor
38-
call torch_tensor_to_array(Q, out_data, shape(in_data))
38+
call torch_tensor_to_array(Q, out_data, shape(in_data1))
3939
write (*,*) "Q = 3 * a ** 3 - b ** 2 =", out_data(:)
4040

4141
! Check a and b are unchanged by the arithmetic operations

src/ftorch.f90

+24-24
Original file line numberDiff line numberDiff line change
@@ -968,7 +968,7 @@ end subroutine torch_model_delete
968968

969969
!> Return a Torch tensor pointing to data_in array of rank 1 containing data of type `int8`
970970
subroutine torch_tensor_from_array_int8_1d(tensor, data_in, layout, &
971-
c_device_type, device_index, requires_grad)
971+
device_type, device_index, requires_grad)
972972
use, intrinsic :: iso_c_binding, only : c_bool, c_float, c_int, c_int64_t, c_loc
973973
use, intrinsic :: iso_fortran_env, only : int8
974974

@@ -1022,7 +1022,7 @@ end subroutine torch_tensor_from_array_int8_1d
10221022

10231023
!> Return a Torch tensor pointing to data_in array of rank 2 containing data of type `int8`
10241024
subroutine torch_tensor_from_array_int8_2d(tensor, data_in, layout, &
1025-
c_device_type, device_index, requires_grad)
1025+
device_type, device_index, requires_grad)
10261026
use, intrinsic :: iso_c_binding, only : c_bool, c_float, c_int, c_int64_t, c_loc
10271027
use, intrinsic :: iso_fortran_env, only : int8
10281028

@@ -1076,7 +1076,7 @@ end subroutine torch_tensor_from_array_int8_2d
10761076

10771077
!> Return a Torch tensor pointing to data_in array of rank 3 containing data of type `int8`
10781078
subroutine torch_tensor_from_array_int8_3d(tensor, data_in, layout, &
1079-
c_device_type, device_index, requires_grad)
1079+
device_type, device_index, requires_grad)
10801080
use, intrinsic :: iso_c_binding, only : c_bool, c_float, c_int, c_int64_t, c_loc
10811081
use, intrinsic :: iso_fortran_env, only : int8
10821082

@@ -1130,7 +1130,7 @@ end subroutine torch_tensor_from_array_int8_3d
11301130

11311131
!> Return a Torch tensor pointing to data_in array of rank 4 containing data of type `int8`
11321132
subroutine torch_tensor_from_array_int8_4d(tensor, data_in, layout, &
1133-
c_device_type, device_index, requires_grad)
1133+
device_type, device_index, requires_grad)
11341134
use, intrinsic :: iso_c_binding, only : c_bool, c_float, c_int, c_int64_t, c_loc
11351135
use, intrinsic :: iso_fortran_env, only : int8
11361136

@@ -1184,7 +1184,7 @@ end subroutine torch_tensor_from_array_int8_4d
11841184

11851185
!> Return a Torch tensor pointing to data_in array of rank 1 containing data of type `int16`
11861186
subroutine torch_tensor_from_array_int16_1d(tensor, data_in, layout, &
1187-
c_device_type, device_index, requires_grad)
1187+
device_type, device_index, requires_grad)
11881188
use, intrinsic :: iso_c_binding, only : c_bool, c_float, c_int, c_int64_t, c_loc
11891189
use, intrinsic :: iso_fortran_env, only : int16
11901190

@@ -1238,7 +1238,7 @@ end subroutine torch_tensor_from_array_int16_1d
12381238

12391239
!> Return a Torch tensor pointing to data_in array of rank 2 containing data of type `int16`
12401240
subroutine torch_tensor_from_array_int16_2d(tensor, data_in, layout, &
1241-
c_device_type, device_index, requires_grad)
1241+
device_type, device_index, requires_grad)
12421242
use, intrinsic :: iso_c_binding, only : c_bool, c_float, c_int, c_int64_t, c_loc
12431243
use, intrinsic :: iso_fortran_env, only : int16
12441244

@@ -1292,7 +1292,7 @@ end subroutine torch_tensor_from_array_int16_2d
12921292

12931293
!> Return a Torch tensor pointing to data_in array of rank 3 containing data of type `int16`
12941294
subroutine torch_tensor_from_array_int16_3d(tensor, data_in, layout, &
1295-
c_device_type, device_index, requires_grad)
1295+
device_type, device_index, requires_grad)
12961296
use, intrinsic :: iso_c_binding, only : c_bool, c_float, c_int, c_int64_t, c_loc
12971297
use, intrinsic :: iso_fortran_env, only : int16
12981298

@@ -1346,7 +1346,7 @@ end subroutine torch_tensor_from_array_int16_3d
13461346

13471347
!> Return a Torch tensor pointing to data_in array of rank 4 containing data of type `int16`
13481348
subroutine torch_tensor_from_array_int16_4d(tensor, data_in, layout, &
1349-
c_device_type, device_index, requires_grad)
1349+
device_type, device_index, requires_grad)
13501350
use, intrinsic :: iso_c_binding, only : c_bool, c_float, c_int, c_int64_t, c_loc
13511351
use, intrinsic :: iso_fortran_env, only : int16
13521352

@@ -1400,7 +1400,7 @@ end subroutine torch_tensor_from_array_int16_4d
14001400

14011401
!> Return a Torch tensor pointing to data_in array of rank 1 containing data of type `int32`
14021402
subroutine torch_tensor_from_array_int32_1d(tensor, data_in, layout, &
1403-
c_device_type, device_index, requires_grad)
1403+
device_type, device_index, requires_grad)
14041404
use, intrinsic :: iso_c_binding, only : c_bool, c_float, c_int, c_int64_t, c_loc
14051405
use, intrinsic :: iso_fortran_env, only : int32
14061406

@@ -1454,7 +1454,7 @@ end subroutine torch_tensor_from_array_int32_1d
14541454

14551455
!> Return a Torch tensor pointing to data_in array of rank 2 containing data of type `int32`
14561456
subroutine torch_tensor_from_array_int32_2d(tensor, data_in, layout, &
1457-
c_device_type, device_index, requires_grad)
1457+
device_type, device_index, requires_grad)
14581458
use, intrinsic :: iso_c_binding, only : c_bool, c_float, c_int, c_int64_t, c_loc
14591459
use, intrinsic :: iso_fortran_env, only : int32
14601460

@@ -1508,7 +1508,7 @@ end subroutine torch_tensor_from_array_int32_2d
15081508

15091509
!> Return a Torch tensor pointing to data_in array of rank 3 containing data of type `int32`
15101510
subroutine torch_tensor_from_array_int32_3d(tensor, data_in, layout, &
1511-
c_device_type, device_index, requires_grad)
1511+
device_type, device_index, requires_grad)
15121512
use, intrinsic :: iso_c_binding, only : c_bool, c_float, c_int, c_int64_t, c_loc
15131513
use, intrinsic :: iso_fortran_env, only : int32
15141514

@@ -1562,7 +1562,7 @@ end subroutine torch_tensor_from_array_int32_3d
15621562

15631563
!> Return a Torch tensor pointing to data_in array of rank 4 containing data of type `int32`
15641564
subroutine torch_tensor_from_array_int32_4d(tensor, data_in, layout, &
1565-
c_device_type, device_index, requires_grad)
1565+
device_type, device_index, requires_grad)
15661566
use, intrinsic :: iso_c_binding, only : c_bool, c_float, c_int, c_int64_t, c_loc
15671567
use, intrinsic :: iso_fortran_env, only : int32
15681568

@@ -1616,7 +1616,7 @@ end subroutine torch_tensor_from_array_int32_4d
16161616

16171617
!> Return a Torch tensor pointing to data_in array of rank 1 containing data of type `int64`
16181618
subroutine torch_tensor_from_array_int64_1d(tensor, data_in, layout, &
1619-
c_device_type, device_index, requires_grad)
1619+
device_type, device_index, requires_grad)
16201620
use, intrinsic :: iso_c_binding, only : c_bool, c_float, c_int, c_int64_t, c_loc
16211621
use, intrinsic :: iso_fortran_env, only : int64
16221622

@@ -1670,7 +1670,7 @@ end subroutine torch_tensor_from_array_int64_1d
16701670

16711671
!> Return a Torch tensor pointing to data_in array of rank 2 containing data of type `int64`
16721672
subroutine torch_tensor_from_array_int64_2d(tensor, data_in, layout, &
1673-
c_device_type, device_index, requires_grad)
1673+
device_type, device_index, requires_grad)
16741674
use, intrinsic :: iso_c_binding, only : c_bool, c_float, c_int, c_int64_t, c_loc
16751675
use, intrinsic :: iso_fortran_env, only : int64
16761676

@@ -1724,7 +1724,7 @@ end subroutine torch_tensor_from_array_int64_2d
17241724

17251725
!> Return a Torch tensor pointing to data_in array of rank 3 containing data of type `int64`
17261726
subroutine torch_tensor_from_array_int64_3d(tensor, data_in, layout, &
1727-
c_device_type, device_index, requires_grad)
1727+
device_type, device_index, requires_grad)
17281728
use, intrinsic :: iso_c_binding, only : c_bool, c_float, c_int, c_int64_t, c_loc
17291729
use, intrinsic :: iso_fortran_env, only : int64
17301730

@@ -1778,7 +1778,7 @@ end subroutine torch_tensor_from_array_int64_3d
17781778

17791779
!> Return a Torch tensor pointing to data_in array of rank 4 containing data of type `int64`
17801780
subroutine torch_tensor_from_array_int64_4d(tensor, data_in, layout, &
1781-
c_device_type, device_index, requires_grad)
1781+
device_type, device_index, requires_grad)
17821782
use, intrinsic :: iso_c_binding, only : c_bool, c_float, c_int, c_int64_t, c_loc
17831783
use, intrinsic :: iso_fortran_env, only : int64
17841784

@@ -1832,7 +1832,7 @@ end subroutine torch_tensor_from_array_int64_4d
18321832

18331833
!> Return a Torch tensor pointing to data_in array of rank 1 containing data of type `real32`
18341834
subroutine torch_tensor_from_array_real32_1d(tensor, data_in, layout, &
1835-
c_device_type, device_index, requires_grad)
1835+
device_type, device_index, requires_grad)
18361836
use, intrinsic :: iso_c_binding, only : c_bool, c_float, c_int, c_int64_t, c_loc
18371837
use, intrinsic :: iso_fortran_env, only : real32
18381838

@@ -1886,7 +1886,7 @@ end subroutine torch_tensor_from_array_real32_1d
18861886

18871887
!> Return a Torch tensor pointing to data_in array of rank 2 containing data of type `real32`
18881888
subroutine torch_tensor_from_array_real32_2d(tensor, data_in, layout, &
1889-
c_device_type, device_index, requires_grad)
1889+
device_type, device_index, requires_grad)
18901890
use, intrinsic :: iso_c_binding, only : c_bool, c_float, c_int, c_int64_t, c_loc
18911891
use, intrinsic :: iso_fortran_env, only : real32
18921892

@@ -1940,7 +1940,7 @@ end subroutine torch_tensor_from_array_real32_2d
19401940

19411941
!> Return a Torch tensor pointing to data_in array of rank 3 containing data of type `real32`
19421942
subroutine torch_tensor_from_array_real32_3d(tensor, data_in, layout, &
1943-
c_device_type, device_index, requires_grad)
1943+
device_type, device_index, requires_grad)
19441944
use, intrinsic :: iso_c_binding, only : c_bool, c_float, c_int, c_int64_t, c_loc
19451945
use, intrinsic :: iso_fortran_env, only : real32
19461946

@@ -1994,7 +1994,7 @@ end subroutine torch_tensor_from_array_real32_3d
19941994

19951995
!> Return a Torch tensor pointing to data_in array of rank 4 containing data of type `real32`
19961996
subroutine torch_tensor_from_array_real32_4d(tensor, data_in, layout, &
1997-
c_device_type, device_index, requires_grad)
1997+
device_type, device_index, requires_grad)
19981998
use, intrinsic :: iso_c_binding, only : c_bool, c_float, c_int, c_int64_t, c_loc
19991999
use, intrinsic :: iso_fortran_env, only : real32
20002000

@@ -2048,7 +2048,7 @@ end subroutine torch_tensor_from_array_real32_4d
20482048

20492049
!> Return a Torch tensor pointing to data_in array of rank 1 containing data of type `real64`
20502050
subroutine torch_tensor_from_array_real64_1d(tensor, data_in, layout, &
2051-
c_device_type, device_index, requires_grad)
2051+
device_type, device_index, requires_grad)
20522052
use, intrinsic :: iso_c_binding, only : c_bool, c_float, c_int, c_int64_t, c_loc
20532053
use, intrinsic :: iso_fortran_env, only : real64
20542054

@@ -2102,7 +2102,7 @@ end subroutine torch_tensor_from_array_real64_1d
21022102

21032103
!> Return a Torch tensor pointing to data_in array of rank 2 containing data of type `real64`
21042104
subroutine torch_tensor_from_array_real64_2d(tensor, data_in, layout, &
2105-
c_device_type, device_index, requires_grad)
2105+
device_type, device_index, requires_grad)
21062106
use, intrinsic :: iso_c_binding, only : c_bool, c_float, c_int, c_int64_t, c_loc
21072107
use, intrinsic :: iso_fortran_env, only : real64
21082108

@@ -2156,7 +2156,7 @@ end subroutine torch_tensor_from_array_real64_2d
21562156

21572157
!> Return a Torch tensor pointing to data_in array of rank 3 containing data of type `real64`
21582158
subroutine torch_tensor_from_array_real64_3d(tensor, data_in, layout, &
2159-
c_device_type, device_index, requires_grad)
2159+
device_type, device_index, requires_grad)
21602160
use, intrinsic :: iso_c_binding, only : c_bool, c_float, c_int, c_int64_t, c_loc
21612161
use, intrinsic :: iso_fortran_env, only : real64
21622162

@@ -2210,7 +2210,7 @@ end subroutine torch_tensor_from_array_real64_3d
22102210

22112211
!> Return a Torch tensor pointing to data_in array of rank 4 containing data of type `real64`
22122212
subroutine torch_tensor_from_array_real64_4d(tensor, data_in, layout, &
2213-
c_device_type, device_index, requires_grad)
2213+
device_type, device_index, requires_grad)
22142214
use, intrinsic :: iso_c_binding, only : c_bool, c_float, c_int, c_int64_t, c_loc
22152215
use, intrinsic :: iso_fortran_env, only : real64
22162216

src/ftorch.fypp

+1-1
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,7 @@ contains
644644
#:for RANK in RANKS
645645
!> Return a Torch tensor pointing to data_in array of rank ${RANK}$ containing data of type `${PREC}$`
646646
subroutine torch_tensor_from_array_${PREC}$_${RANK}$d(tensor, data_in, layout, &
647-
c_device_type, device_index, requires_grad)
647+
device_type, device_index, requires_grad)
648648
use, intrinsic :: iso_c_binding, only : c_bool, c_float, c_int, c_int64_t, c_loc
649649
use, intrinsic :: iso_fortran_env, only : ${PREC}$
650650

0 commit comments

Comments
 (0)