Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion deepxde/backend/paddle/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,17 @@
from .tensor import * # pylint: disable=redefined-builtin
import os

from .tensor import * # pylint: disable=redefined-builtin

# enable prim if specified
enable_prim_value = os.getenv("PRIM")
enable_prim = enable_prim_value.lower() in ['1', 'true', 'yes', 'on'] if enable_prim_value else False
if enable_prim:
# Mostly for compiler running with dy2st.
from paddle.framework import core

core.set_prim_eager_enabled(True)
# The following protected member access is required.
# There is no alternative public API available now.
# pylint: disable=protected-access
core._set_prim_all_enabled(True)
print("Prim mode is enabled.")