未验证 提交 a17e51dd 编写于 作者: Z Zhanlue Yang 提交者: GitHub

Fixed python-level LoDTensor patch (#38996)

上级 5406e6f8
...@@ -32,10 +32,6 @@ if os.path.exists(legacy_core): ...@@ -32,10 +32,6 @@ if os.path.exists(legacy_core):
except Exception as e: except Exception as e:
raise e raise e
# Patch LoDTensor
from . import core
core.LoDTensor = core.Tensor
# import all class inside framework into fluid module # import all class inside framework into fluid module
from . import framework from . import framework
from .framework import * from .framework import *
......
...@@ -253,6 +253,9 @@ load_noavx = False ...@@ -253,6 +253,9 @@ load_noavx = False
if avx_supported(): if avx_supported():
try: try:
from . import core_avx
core_avx.LoDTensor = core_avx.Tensor
from .core_avx import * from .core_avx import *
from .core_avx import __doc__, __file__, __name__, __package__ from .core_avx import __doc__, __file__, __name__, __package__
from .core_avx import __unittest_throw_exception__ from .core_avx import __unittest_throw_exception__
...@@ -310,6 +313,9 @@ else: ...@@ -310,6 +313,9 @@ else:
if load_noavx: if load_noavx:
try: try:
from . import core_noavx
core_noavx.LoDTensor = core_noavx.Tensor
from .core_noavx import * from .core_noavx import *
from .core_noavx import __doc__, __file__, __name__, __package__ from .core_noavx import __doc__, __file__, __name__, __package__
from .core_noavx import __unittest_throw_exception__ from .core_noavx import __unittest_throw_exception__
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册