[petsc-users] Calling Pytorch and Python within PETSc C/C++ code

Zhang, Hong hongzhang at anl.gov
Mon Jun 13 15:42:13 CDT 2022


No. It is not common to execute Python scripts or libraries from C/C++ code. If you are looking for ways to use PETSc and PyTorch together, it is best to build your application in Python so that you can use both petsc4py and PyTorch. See the following code for an example:
https://github.com/caidao22/pnode

Hong (Mr.)

On Jun 13, 2022, at 9:50 AM, Amneet Bhalla <mail2amneet at gmail.com<mailto:mail2amneet at gmail.com>> wrote:


Hi Guys,

Is there a PETSc interface to make calls to Python scripts or libraries (e.g., Pytorch) from a C/C++ code making use of PETSc? If so, are there some examples that I refer to?

Thanks,
--
--Amneet




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20220613/054a6bf8/attachment.html>


More information about the petsc-users mailing list