IfElse question
Created by: panyx0718
>>> a = fluid.layers.fill_constant(shape=[], dtype='int64', value=5)
>>> b = fluid.layers.fill_constant(shape=[], dtype='int64', value=6)
>>> ifcond = fluid.layers.less_than(x=a, y=b)
>>> ie = fluid.layers.IfElse(ifcond)
>>> with ie.true_block():
... c = ie.input(a)
... c += 1
... ie.output(c)
...
Traceback (most recent call last):
File "<stdin>", line 2, in <module>
File "/paddle/build/python/paddle/fluid/layers/control_flow.py", line 1329, in input
attrs={'level': 0})
File "/paddle/build/python/paddle/fluid/framework.py", line 1300, in append_op
attrs=kwargs.get("attrs", None))
File "/paddle/build/python/paddle/fluid/framework.py", line 710, in __init__
self.desc.infer_shape(self.block.desc)
paddle.fluid.core.EnforceNotMet: Enforce failed. Expected mask_dim.size() == 2, but received mask_dim.size():1 != 2:2.
at [/paddle/Paddle/paddle/fluid/operators/split_lod_tensor_op.cc:159]
PaddlePaddle Call Stacks:
0 0x7f2fe7831b1dp void paddle::platform::EnforceNotMet::Init<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, char const*, int) + 509
1 0x7f2fe7832df2p paddle::platform::EnforceNotMet::EnforceNotMet<char const*, char const*, char const*, char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(char const*, int, char const*, char const*, char const*, char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) + 162
2 0x7f2fe7b90d14p paddle::operators::SplitLoDTensorInferShape::operator()(paddle::framework::InferShapeContext*) const + 932
3 0x7f2fe7b91352p std::_Function_handler<void (paddle::framework::InferShapeContext*), paddle::framework::details::OpInfoFiller<paddle::operators::SplitLoDTensorInferShape, (paddle::framework::details::OpInfoFillType)4>::operator()(char const*, paddle::framework::OpInfo*) const::{lambda(paddle::framework::InferShapeContext*)#1}>::_M_invoke(std::_Any_data const&, paddle::framework::InferShapeContext*&&) + 50
4 0x7f2fe792c3eap paddle::framework::OpDesc::InferShape(paddle::framework::BlockDesc const&) const + 986