| 272 | } |
| 273 | |
| 274 | void ReshapeBrdcastHelper::add_input_layout_constraint() { |
| 275 | if (!cg::is_static_var_value(input(1))) |
| 276 | return; |
| 277 | |
| 278 | auto check_layout = [this](const TensorLayout& layout) { |
| 279 | MGB_TRY { |
| 280 | TensorShape oshp; |
| 281 | outshape_by_symvar_do_get_output_shape( |
| 282 | oshp, outshape_by_symvar_get_shape_infer_info()); |
| 283 | return reshapebrdcast_get_dest_layout(layout, oshp).valid(); |
| 284 | } |
| 285 | MGB_CATCH(MegBrainError & exc, { |
| 286 | if (!exc.extra_info()) |
| 287 | cg::OperatorNodeExcExtraInfo::record(this, exc); |
| 288 | throw; |
| 289 | }) |
| 290 | }; |
| 291 | input(0)->add_layout_constraint(check_layout); |
| 292 | } |
| 293 | |
| 294 | void ReshapeBrdcastHelper::init_output_static_infer_desc() { |
| 295 | Super::init_output_static_infer_desc(); |
nothing calls this directly
no test coverage detected