Skip to content

Commit 0053ba8

Browse files
authored
[Eager] Fix tensor type (#41468) (#41692)
1 parent 48e1b11 commit 0053ba8

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

python/paddle/tensor/logic.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,13 @@
1616
from ..fluid.data_feeder import check_type, check_variable_and_dtype
1717
from ..fluid.layers.layer_function_generator import templatedoc
1818
from ..static import Variable
19-
from ..framework import VarBase as Tensor
2019
from ..fluid.framework import _in_legacy_dygraph, in_dygraph_mode
21-
# TODO: define logic functions of a tensor
20+
# TODO: define logic functions of a tensor
21+
import paddle.fluid as fluid
22+
if fluid.framework._in_eager_mode_:
23+
Tensor = fluid.framework.core.eager.Tensor
24+
else:
25+
from ..framework import VarBase as Tensor
2226
from ..fluid.layers import is_empty # noqa: F401
2327
from ..fluid.layers import logical_and # noqa: F401
2428
from ..fluid.layers import logical_not # noqa: F401

0 commit comments

Comments
 (0)