Python integration
MathOptAI uses PythonCall.jl to call from Julia into Python.
To use PytorchModel your code must load the PythonCall package:
import PythonCallPythonCall uses CondaPkg.jl to manage Python dependencies. See CondaPkg.jl for more control over how to link Julia to an existing Python environment.
If you have an existing Python installation (with PyTorch installed), and it is available in the current Conda environment, do:
ENV["JULIA_CONDAPKG_BACKEND"] = "Current"
import PythonCallIf the Python installation can be found on the path and it is not in a Conda environment, do:
ENV["JULIA_CONDAPKG_BACKEND"] = "Null"
import PythonCallIf python is not on your path, you may additionally need to set JULIA_PYTHONCALL_EXE, for example, do:
ENV["JULIA_PYTHONCALL_EXE"] = "python3"
ENV["JULIA_CONDAPKG_BACKEND"] = "Null"
import PythonCall