| 676 | } |
| 677 | |
| 678 | void NetworkImplDft::try_infer_tensor_layout(std::shared_ptr<Tensor> tensor, Var var) { |
| 679 | using InferType = mgb::cg::static_infer::InferType; |
| 680 | auto&& static_infer_mgr = m_load_config.comp_graph->static_infer_manager(); |
| 681 | if (static_infer_mgr.get_infer_type(var.node()).shape & |
| 682 | (InferType::CONST | InferType::RT_STATIC)) { |
| 683 | auto shape = static_infer_mgr.infer_shape_fallible(var.node()); |
| 684 | if (!shape) { |
| 685 | LITE_WARN( |
| 686 | "Lite infer output shape failed, maybe the model is " |
| 687 | "dynamic " |
| 688 | "shape.\n"); |
| 689 | LITE_ASSERT( |
| 690 | !m_user_config->options.force_output_use_user_specified_memory, |
| 691 | "force_output_use_user_specified_memory can't be used when output " |
| 692 | "shape can't be derived."); |
| 693 | return; |
| 694 | } |
| 695 | Layout layout = to_lite_layout(TensorLayout{*shape, var.dtype()}); |
| 696 | tensor->set_layout(layout); |
| 697 | } |
| 698 | } |
| 699 | |
| 700 | void NetworkImplDft::update_io() { |
| 701 | update_input(); |
nothing calls this directly
no test coverage detected