locoex::TFLConst *_const_node;
locoex::TFLConv2D *_conv2d_node;
- locoex::TFLConst *create_fused_bias();
+ locoex::TFLConst *create_fused_bias_const();
};
-template <typename TFLType> locoex::TFLConst *Fuser<TFLType>::create_fused_bias()
+template <typename TFLType> locoex::TFLConst *Fuser<TFLType>::create_fused_bias_const()
{
- // we have to create a new bias by adding/substracting bias and const node (of TFLAdd or TFLSub)
+ // we have to create a new bias const by adding/substracting bias and const node (of TFLAdd or
+ // TFLSub)
auto bias = dynamic_cast<locoex::TFLConst *>(_conv2d_node->bias());
assert(bias->dtype() == loco::DataType::FLOAT32 &&
_const_node->dtype() == loco::DataType::FLOAT32);
assert(bias->rank() == 1 && _const_node->rank() == 1);
assert(bias->dim(0) == _const_node->dim(0));
- // build a new bias
+ // build a new bias const
auto new_bias = _graph->nodes()->create<locoex::TFLConst>();
{
new_bias->dtype(loco::DataType::FLOAT32);
act_func<TFLType>(_conv2d_node, _fusable_node);
}
- auto new_bias = create_fused_bias();
+ auto new_bias = create_fused_bias_const();
// replace node with new_bias
// note that loco::replace() is not used because bias could be input of other op just in case