Check for Any/All reduction explicitly
This commit is contained in:
parent
bb196f949f
commit
a3b0b87aa2
@ -2474,9 +2474,10 @@ bool ConstantFolding::ReplaceReductionWithIdentity(NodeDef* node) const {
|
||||
DataType output_type;
|
||||
if (node->attr().count("T") != 0) {
|
||||
output_type = node->attr().at("T").type();
|
||||
} else {
|
||||
// This is an 'any' or 'all' reduction. The output is always boolean.
|
||||
} else if (IsAny(*node) || IsAll(*node)) {
|
||||
output_type = DT_BOOL;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
node->set_op("Identity");
|
||||
node->clear_attr();
|
||||
|
Loading…
Reference in New Issue
Block a user