未验证 提交 c7c4cec7 编写于 作者: W Weilong Wu 提交者: GitHub

[Eager] fix multiplex interface under different mode (#45645)

上级 6d5c3813
...@@ -299,8 +299,11 @@ def multiplex(inputs, index, name=None): ...@@ -299,8 +299,11 @@ def multiplex(inputs, index, name=None):
print(res) # Tensor([[5., 6.], [3., 4.]], dtype=float32) print(res) # Tensor([[5., 6.], [3., 4.]], dtype=float32)
""" """
if _non_static_mode(): if in_dygraph_mode():
return _C_ops.multiplex(inputs, index)
elif _in_legacy_dygraph():
return _legacy_C_ops.multiplex(index, inputs) return _legacy_C_ops.multiplex(index, inputs)
helper = LayerHelper('multiplex', **locals()) helper = LayerHelper('multiplex', **locals())
check_type(inputs, 'inputs', (list), 'multiplex') check_type(inputs, 'inputs', (list), 'multiplex')
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册