Skip to content

Commit

Permalink
check as_type_ptr return
Browse files Browse the repository at this point in the history
  • Loading branch information
alvoron committed Jan 31, 2025
1 parent cf5134e commit a2fcf2e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/plugins/intel_cpu/src/nodes/pooling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,11 @@ dnnl::pooling_forward::primitive_desc createDescriptorHelper(const dnnl::engine&

bool Pooling::isSupportedOperation(const std::shared_ptr<const ov::Node>& op, std::string& errorMessage) noexcept {
#if defined(OV_CPU_WITH_ACL)
auto maxPoolOpBase = ov::as_type_ptr<const ov::op::util::MaxPoolBase>(op);
if (maxPoolOpBase->get_kernel() != ov::Shape(2,2)) {
errorMessage = "Pooling indices returning source tensor coordinates is only supported for pool size 2x2";
return false;
if (auto maxPoolOpBase = ov::as_type_ptr<const ov::op::util::MaxPoolBase>(op)) {
if (maxPoolOpBase->get_kernel() != ov::Shape(2,2)) {
errorMessage = "Pooling indices returning source tensor coordinates is only supported for pool size 2x2";
return false;
}
}
#endif
try {
Expand Down

0 comments on commit a2fcf2e

Please sign in to comment.