Skip to content

Commit 0faa738

Browse files
committed
Update example 5 to fix mismatching TorchScript and executable names.
1 parent 3e789df commit 0faa738

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

examples/5_Looping/CMakeLists.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,17 @@ execute_process(COMMAND ${Python_EXECUTABLE} -m pip install -r
3030
${PROJECT_SOURCE_DIR}/requirements.txt)
3131

3232
# Fortran example - bad
33-
add_executable(example5_simplenet_infer_fortran_bad
33+
add_executable(simplenet_infer_fortran_bad
3434
bad/simplenet_infer_fortran.f90)
35-
target_link_libraries(example5_simplenet_infer_fortran_bad
35+
target_link_libraries(simplenet_infer_fortran_bad
3636
PRIVATE FTorch::ftorch)
37-
target_sources(example5_simplenet_infer_fortran_bad
37+
target_sources(simplenet_infer_fortran_bad
3838
PRIVATE bad/fortran_ml_mod.f90)
3939

4040
# Fortran example - good
41-
add_executable(example5_simplenet_infer_fortran_good
41+
add_executable(simplenet_infer_fortran_good
4242
good/simplenet_infer_fortran.f90)
43-
target_link_libraries(example5_simplenet_infer_fortran_good
43+
target_link_libraries(simplenet_infer_fortran_good
4444
PRIVATE FTorch::ftorch)
45-
target_sources(example5_simplenet_infer_fortran_good
45+
target_sources(simplenet_infer_fortran_good
4646
PRIVATE good/fortran_ml_mod.f90)

examples/5_Looping/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ To save the SimpleNet model to TorchScript, run the modified version of the
9090
```
9191
python3 pt2ts.py
9292
```
93-
which will generate `saved_simplenet_model.pt` - the TorchScript instance of
93+
which will generate `saved_simplenet_cpu.pt` - the TorchScript instance of
9494
the network and perform a quick sanity check that it can be read.
9595

9696
At this point we no longer require Python, so can deactivate the virtual

examples/5_Looping/bad/fortran_ml_mod.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ subroutine ml_routine(in_data, out_data)
3737
call torch_tensor_from_array(output_tensors(1), out_data, tensor_layout, torch_kCPU)
3838

3939
! Load ML model
40-
model_torchscript_file = '../saved_simplenet_model.pt'
40+
model_torchscript_file = '../saved_simplenet_cpu.pt'
4141
call torch_model_load(torch_net, model_torchscript_file, torch_kCPU)
4242

4343
! Infer

examples/5_Looping/good/fortran_ml_mod.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ module ml_mod
2929
subroutine ml_init()
3030

3131
! Load ML model
32-
model_torchscript_file = '../saved_simplenet_model.pt'
32+
model_torchscript_file = '../saved_simplenet_cpu.pt'
3333
call torch_model_load(torch_net, model_torchscript_file, torch_kCPU)
3434

3535
end subroutine ml_init

0 commit comments

Comments
 (0)