Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error if bounds are not infinity #7077

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/operators/binary-elementwise-nd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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(
Expand Down
Loading