bool fix_shape(moco::tf::TFConst *node)
{
- // TODO implement this
- throw std::runtime_error("NYI fix_shape for TFConst");
+ auto shapedata = node->annot<ShapeInferenceData>();
+ if (shapedata != nullptr)
+ {
+ // shape inference is already done for TFConst
+ return false;
+ }
+
+ // TFConst itself has shape information, copy them
+ auto shape_data = stdex::make_unique<ShapeInferenceData>();
+ copy_shape_values(node, shape_data.get());
+ node->annot(std::move(shape_data));
+
+ return true;
}
bool fix_shape(moco::tf::TFConv2D *node)