CompileTimeInferShapeContext::HasInput needs to handle empty input
Created by: tonyyang-svail
Suspect bug in https://github.com/PaddlePaddle/Paddle/blob/develop/paddle/framework/operator.h#L327
Traceback:
======================================================================
ERROR: test_check_output (__main__.TestCropOp)
----------------------------------------------------------------------
Traceback (most recent call last):
File "../python/paddle/v2/framework/tests/test_crop_op.py", line 54, in test_check_output
self.check_output()
File "/paddle/python/paddle/v2/framework/tests/op_test.py", line 350, in check_output
self.check_output_with_place(place, atol)
File "/paddle/python/paddle/v2/framework/tests/op_test.py", line 302, in check_output_with_place
attrs=self.attrs if hasattr(self, "attrs") else dict())
File "/usr/local/lib/python2.7/dist-packages/paddle/v2/framework/framework.py", line 351, in append_op
op = Operator(self, op_desc, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/paddle/v2/framework/framework.py", line 259, in __init__
self.desc.infer_shape(self.block.desc)
EnforceNotMet: Input Y cannot be found in Op crop at [/paddle/paddle/framework/op_desc.cc:43]
PaddlePaddle Call Stacks:
0 0x7f9976d09706p paddle::platform::EnforceNotMet::EnforceNotMet(std::__exception_ptr::exception_ptr, char const*, int) + 582
1 0x7f9976d92604p paddle::framework::OpDescBind::Input(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const + 324
2 0x7f9976d96766p paddle::framework::CompileTimeInferShapeContext::HasInput(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const + 54