forked from Cambridge-ICCS/fortran-tf-lib
-
Notifications
You must be signed in to change notification settings - Fork 3
Hackathon
Simon Clifford edited this page Sep 23, 2022
·
3 revisions
- Fortran
- Some Python
- Little or no TensorFlow
We want to finish the process_model
script so that integrating TensorFlow ML models into Fortran is simple(r). To achieve this I think we need to do the some or all of the following:
- Write a test for process_model. Interestingly this will require us to solve many of the problems, since the correct output will be the Fortran we need to generate!
- Have
process_model
generate this Fortran code. - Make sure the Fortran code compiles and test it does what we want.
- There may be options we need to cover, these will need extra tests. E.g. loading two models, or passing a
--tags
option. - Nicely document all of this. Perhaps a worked example.
- Fork this repository into your Github account.
- Clone it locally, checking out the
tensorflow
branch.git clone -b tensorflow <your-repo-url>
- Create a python3 environment (virtualenv, conda) and activate it.
- Change to
fortran-ml-bridge-hackathon/fortran-tf-lib/tools
and runpip install -e process_model
. This will install the tool as an editable package and bring in its dependencies.
- Follow the instructions in the TF README to download and install the TensorFlow C library, and build the Fortran-TF library.
- Now when we run e.g.
process_model -o test.F90
we can compile the outputted Fortran with something like the following:
ifort -c -I ../../src test.F90
(the argument to the -I
flag is wherever the .mod
file for the library has been generated).
- If we get to the point where we start building actual examples we'll need to link to the generated library, and the TF C library.