Commit 6a8185f 1 parent 4438add commit 6a8185f Copy full SHA for 6a8185f
File tree 1 file changed +11
-2
lines changed
1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -658,10 +658,19 @@ bool Constant::has_evaluate() const {
658
658
}
659
659
660
660
bool Constant::evaluate_lower (TensorVector& outputs) const {
661
- return evaluate (outputs, {});
661
+ if (!outputs.empty () && outputs[0 ].get_element_type () != m_element_type)
662
+ return evaluate (outputs, {}); // for TypeRelaxed<Constant>
663
+ outputs.resize (1 );
664
+ outputs[0 ] = get_tensor_view ();
665
+ return get_data_ptr () != nullptr ;
662
666
}
667
+
663
668
bool Constant::evaluate_upper (TensorVector& outputs) const {
664
- return evaluate (outputs, {});
669
+ if (!outputs.empty () && outputs[0 ].get_element_type () != m_element_type)
670
+ return evaluate (outputs, {}); // for TypeRelaxed<Constant>
671
+ outputs.resize (1 );
672
+ outputs[0 ] = get_tensor_view ();
673
+ return get_data_ptr () != nullptr ;
665
674
}
666
675
667
676
bool Constant::can_constant_fold (const OutputVector& input_values) const {
You can’t perform that action at this time.
0 commit comments