diff --git a/src/operators/binary-elementwise-nd.c b/src/operators/binary-elementwise-nd.c index fc460bda0f0..b8fa6aaee3c 100644 --- a/src/operators/binary-elementwise-nd.c +++ b/src/operators/binary-elementwise-nd.c @@ -98,6 +98,12 @@ static enum xnn_status create_binary_elementwise_nd_f16( const struct xnn_binary_elementwise_config* config, xnn_operator_t* binary_elementwise_op_out) { + if (output_min != -INFINITY || output_max != INFINITY) { + xnn_log_error( + "failed to create %s operator with bounded outputs [%.7g, %.7g]", + xnn_operator_type_to_string(operator_type), output_min, output_max); + return xnn_status_invalid_parameter; + } if (isnan(output_min)) { xnn_log_error( "failed to create %s operator with NaN output lower bound: lower bound must be non-NaN", @@ -155,6 +161,12 @@ static enum xnn_status create_binary_elementwise_nd_f32( xnn_operator_type_to_string(operator_type)); return xnn_status_uninitialized; } + if (output_min != -INFINITY || output_max != INFINITY) { + xnn_log_error( + "failed to create %s operator with bounded outputs [%.7g, %.7g]", + xnn_operator_type_to_string(operator_type), output_min, output_max); + return xnn_status_invalid_parameter; + } if (isnan(output_min)) { xnn_log_error(