INFO(l) << "Add fuse_to_preceding: addparam has no shape";
return false;
}
- // if AddParam rank is not 1 we cannot fuse, just skip
+ // if AddParam rank is not 0 or 1 we cannot fuse, just skip
auto addparam_shape = addparam_shape_inf->tensor_shape();
- if (addparam_shape.rank() != 1)
+ if (addparam_shape.rank() > 1)
{
- // TODO do something when rank() is 0
- assert(addparam_shape.rank() == 0);
- INFO(l) << "Add fuse_to_preceding: Add rank is not 1";
+ INFO(l) << "Add fuse_to_preceding: Add rank is not 0 or 1";
return false;
}
+ // TODO do something when rank() is 0
+ assert(addparam_shape.rank() != 0);
+
// TODO support FullyConnected
moco::tf::TFBiasAdd *biasadd = nullptr;
if (auto conv2d = dynamic_cast<moco::tf::TFConv2D *>(precedingOp))