| 618 | void RuntimeInferShapeContext::SetSkipLoD(bool skip) { can_skip_lod_ = skip; } |
| 619 | |
| 620 | bool RuntimeInferShapeContext::HasRuntimeAttributes() const { |
| 621 | bool is_runtime = false; |
| 622 | if (phi::DefaultKernelSignatureMap::Instance().Has(op_.Type())) { |
| 623 | auto phi_kernels = phi::KernelFactory::Instance().SelectKernelMap( |
| 624 | GetPhiDefaultKernelSignature()->name); |
| 625 | if (!phi_kernels.empty()) { |
| 626 | const auto& args_def = phi_kernels.cbegin()->second.args_def(); |
| 627 | const auto& attr_defs = args_def.attribute_defs(); |
| 628 | for (size_t i = 0; i < attr_defs.size(); ++i) { |
| 629 | if (attr_defs[i].type_index == phi::AttributeType::SCALAR || |
| 630 | attr_defs[i].type_index == phi::AttributeType::INT_ARRAY) { |
| 631 | is_runtime = true; |
| 632 | break; |
| 633 | } |
| 634 | } |
| 635 | } |
| 636 | } else { |
| 637 | is_runtime = true; |
| 638 | } |
| 639 | return is_runtime; |
| 640 | } |
| 641 | |
| 642 | std::vector<LegacyLoD> RuntimeInferShapeContext::GetOutputsLod( |
| 643 | const std::string& out) const { |