Skip to content

Commit f244fb0

Browse files
authored
Apply suggestions from code review
1 parent 42d669f commit f244fb0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/core/src/op/constant.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -658,12 +658,16 @@ bool Constant::has_evaluate() const {
658658
}
659659

660660
bool Constant::evaluate_lower(TensorVector& outputs) const {
661+
if (!outputs.empty() && outputs[0].get_element_type() != m_element_type)
662+
return evaluate(outputs, {}); // for TypeRelaxed<Constant>
661663
outputs.resize(1);
662664
outputs[0] = get_tensor_view();
663665
return get_data_ptr() != nullptr;
664666
}
665667

666668
bool Constant::evaluate_upper(TensorVector& outputs) const {
669+
if (!outputs.empty() && outputs[0].get_element_type() != m_element_type)
670+
return evaluate(outputs, {}); // for TypeRelaxed<Constant>
667671
outputs.resize(1);
668672
outputs[0] = get_tensor_view();
669673
return get_data_ptr() != nullptr;

0 commit comments

Comments
 (0)