...
 
Commits (4)
    https://gitcode.net/paddlepaddle/X2Paddle/-/commit/b220a63ef416db3f840798b53d151cccca1581f0 fixed import models bug 2023-04-12T11:54:59+08:00 wjj19950828 wjjisloser@163.com https://gitcode.net/paddlepaddle/X2Paddle/-/commit/bae722ecf56bdb6e1db9437fbad69e6189cacd49 fixed import models bug 2023-04-12T14:11:33+08:00 wjj19950828 wjjisloser@163.com https://gitcode.net/paddlepaddle/X2Paddle/-/commit/42995b86f26e91f06c5e82e7d6b8a36372da1805 fixed import models bug 2023-04-12T14:13:18+08:00 wjj19950828 wjjisloser@163.com https://gitcode.net/paddlepaddle/X2Paddle/-/commit/3844a5a589cb4442b70af90256bdf1c4609c0053 Merge pull request #963 from PaddlePaddle/fixed_models 2023-04-23T12:26:57+08:00 Jason jiangjiajun@baidu.com [Bug]Fixed from x2paddle import models error
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
# limitations under the License. # limitations under the License.
import paddle import paddle
from paddle.fluid.core import VarBase from paddle.framework import core
from x2paddle.utils import paddle_dtypes from x2paddle.utils import paddle_dtypes
...@@ -24,7 +24,7 @@ def is_condition_one(idx): ...@@ -24,7 +24,7 @@ def is_condition_one(idx):
a[mask, :] a[mask, :]
a[mask, ...] a[mask, ...]
""" """
if not (isinstance(idx[0], paddle.Tensor) and \ if not (isinstance(idx[0], paddle.Tensor) and
idx[0].dtype == paddle_dtypes.t_bool): idx[0].dtype == paddle_dtypes.t_bool):
return False return False
if len(idx) == 1: if len(idx) == 1:
...@@ -53,6 +53,8 @@ def is_condition_two(idx): ...@@ -53,6 +53,8 @@ def is_condition_two(idx):
return False return False
VarBase = core.eager.Tensor
VarBase.tmp = VarBase.__getitem__ VarBase.tmp = VarBase.__getitem__
......