bool fix_shape(loco::Pull *node)
{
- auto shapedata = node->annot<ShapeInferenceData>();
- if (shapedata != nullptr)
- {
- // shape inference is already done for Pull
+ if (shape_inference_done(node))
return false;
- }
// Pull itself has shape information, copy them
auto shape_data = make_shape_inference_data(node);
{
LOGGER(l);
- auto shapedata = node->annot<ShapeInferenceData>();
- if (shapedata != nullptr)
- {
- // shape inference is already done for TFAvgPool
+ if (shape_inference_done(node))
return false;
- }
+
auto value = node->value();
loco::NodeShape value_shape;
if (!node_shape(value, value_shape))
{
LOGGER(l);
- if (node->annot<ShapeInferenceData>() != nullptr)
+ if (shape_inference_done(node))
{
- // shape inference is already done for TFConcatV2
INFO(l) << "Fix shape TFConcatV2 already done";
return false;
}
bool fix_shape(moco::tf::TFConst *node)
{
- auto shapedata = node->annot<ShapeInferenceData>();
- if (shapedata != nullptr)
- {
- // shape inference is already done for TFConst
+ if (shape_inference_done(node))
return false;
- }
// TFConst itself has shape information, copy them
auto shape_data = make_shape_inference_data(node);
{
LOGGER(l);
- auto shapedata = node->annot<ShapeInferenceData>();
- if (shapedata != nullptr)
- {
- // shape inference is already done
+ if (shape_inference_done(node))
return false;
- }
+
auto ifm = node->ifm();
loco::NodeShape ifm_shape;
if (!node_shape(ifm, ifm_shape))
{
LOGGER(l);
- auto shapedata = node->annot<ShapeInferenceData>();
- if (shapedata != nullptr)
- {
- // shape inference is already done
+ if (shape_inference_done(node))
return false;
- }
+
auto ifm = node->ifm();
loco::NodeShape ifm_shape;
if (!node_shape(ifm, ifm_shape))
{
LOGGER(l);
- auto shapedata = node->annot<ShapeInferenceData>();
- if (shapedata != nullptr)
- {
- // shape inference is already done for TFMaxPool
+ if (shape_inference_done(node))
return false;
- }
+
auto value = node->value();
loco::NodeShape value_shape;
if (!node_shape(value, value_shape))
bool fix_shape(moco::tf::TFReshape *node)
{
- auto shapedata = node->annot<ShapeInferenceData>();
- if (shapedata != nullptr)
- {
- // shape inference is already done for TFReshape
+ if (shape_inference_done(node))
return false;
- }
// For now, we only consider Fixed Reshape, i.e. Reshape with determined
// 'shape' input. So here we only support case when 'shape' input of
bool fix_shape(moco::tf::TFShape *node)
{
- auto shapedata = node->annot<ShapeInferenceData>();
- if (shapedata != nullptr)
- {
- // shape inference is already done for TFShape
+ if (shape_inference_done(node))
return false;
- }
auto input = node->input();
loco::NodeShape input_shape;
bool fix_shape(moco::tf::TFSqueeze *node)
{
- auto shapedata = node->annot<ShapeInferenceData>();
- if (shapedata != nullptr)
- {
- // shape inference is already done for TFSqueeze
+ if (shape_inference_done(node))
return false;
- }
auto input = node->input();
loco::NodeShape input_shape;