[ME][Fallback] Handle interpret nodes in list.
This commit is contained in:
parent
97128247d5
commit
fa8506c0a7
|
@ -1038,6 +1038,7 @@ AnfNodePtr Parser::ParseList(const FunctionBlockPtr &block, const py::object &no
|
|||
list_vec.emplace_back(make_list_op);
|
||||
for (size_t i = 0; i < elts.size(); i++) {
|
||||
AnfNodePtr node_ptr = ParseExprNode(block, elts[i]);
|
||||
node_ptr = HandleInterpret(block, node_ptr, elts[i]);
|
||||
list_vec.emplace_back(node_ptr);
|
||||
}
|
||||
CNodePtr list_app = block->func_graph()->NewCNodeInOrder(std::move(list_vec));
|
||||
|
|
|
@ -84,6 +84,21 @@ def test_tuple_of_tensor():
|
|||
print(use_tuple_of_tensor())
|
||||
|
||||
|
||||
@ms_function
|
||||
def use_list_of_tensor():
|
||||
me_x = [Tensor(1), Tensor(1)]
|
||||
return me_x
|
||||
|
||||
|
||||
def test_list_of_tensor():
|
||||
"""
|
||||
Feature: JIT Fallback
|
||||
Description: Test list of tensor in graph mode.
|
||||
Expectation: No exception.
|
||||
"""
|
||||
print(use_list_of_tensor())
|
||||
|
||||
|
||||
class Net(nn.Cell):
|
||||
def __init__(self):
|
||||
super(Net, self).__init__()
|
||||
|
|
Loading…
Reference in New Issue