MCPcopy Create free account
hub / github.com/PaddlePaddle/Paddle / HasRuntimeAttributes

Method HasRuntimeAttributes

paddle/fluid/framework/operator.cc:620–640  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

618void RuntimeInferShapeContext::SetSkipLoD(bool skip) { can_skip_lod_ = skip; }
619
620bool 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
642std::vector<LegacyLoD> RuntimeInferShapeContext::GetOutputsLod(
643 const std::string& out) const {

Callers 2

ResetContextMethod · 0.80
ResetContextWithScopeMethod · 0.80

Calls 8

InstanceFunction · 0.85
SelectKernelMapMethod · 0.80
args_defMethod · 0.80
HasMethod · 0.45
TypeMethod · 0.45
emptyMethod · 0.45
cbeginMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected