def _check_shape(placeholder_shape, data_shape):
return True<EOL>squeezed_placeholder_shape = _squeeze_shape(placeholder_shape)<EOL>squeezed_data_shape = _squeeze_shape(data_shape)<EOL>for i, s_data in enumerate(squeezed_data_shape):<EOL><INDENT>s_placeholder = squeezed_placeholder_shape[i]<EOL>if s_placeholder != -<NUM_LIT:1> and s_data != s_placeholder:<EOL><INDENT>return False<EOL><DEDENT><DEDENT>return True<EOL>
check if two shapes are compatible (i.e. differ only by dimensions of size 1, or by the batch dimension)