Shape validation of `max_features` in `QuantizedReluX`
authorYong Tang <yong.tang.github@outlook.com>
Sun, 13 May 2018 14:26:06 +0000 (14:26 +0000)
committerYong Tang <yong.tang.github@outlook.com>
Mon, 14 May 2018 00:32:31 +0000 (00:32 +0000)
In shape function of QuantizedReluX, `max_value` and
`min_features` have shape validation but not `max_features`.
This fix add restriction to `max_features` as well.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
tensorflow/core/ops/nn_ops.cc

index bb46daf..7c579db 100644 (file)
@@ -1452,6 +1452,7 @@ REGISTER_OP("QuantizedReluX")
       ShapeHandle unused;
       TF_RETURN_IF_ERROR(c->WithRank(c->input(1), 0, &unused));
       TF_RETURN_IF_ERROR(c->WithRank(c->input(2), 0, &unused));
+      TF_RETURN_IF_ERROR(c->WithRank(c->input(3), 0, &unused));
       c->set_output(1, c->Scalar());
       c->set_output(2, c->Scalar());
       return Status::OK();