Skip to content

Commit e2f6a9d

Browse files
committed
Handle allocation of pointer array
1 parent 0f6ee05 commit e2f6a9d

File tree

3 files changed

+526
-127
lines changed

3 files changed

+526
-127
lines changed

examples/5_Autograd/autograd.f90

+1-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ program example
2424
call torch_tensor_from_array(a, in_data, tensor_layout, torch_kCPU)
2525

2626
! Extract a Fortran array from a Torch tensor
27-
allocate(out_data(2))
28-
call torch_tensor_to_array(a, out_data)
27+
call torch_tensor_to_array(a, out_data, shape(in_data))
2928
write (*,*) "a = ", out_data(:)
3029

3130
! Cleanup

0 commit comments

Comments
 (0)