// creating TF dialect Add node
auto tf_add = graph->nodes()->create<TFAdd>();
+ tf_add->name(node.name());
TensorName output_name(node.name(), 0);
tensor_names->enroll(output_name, tf_add);
// tensorflow data_format: one of NHWC or NCHW.
auto data_layout = get_string_attr(node, "data_format");
auto avgPool_node = graph->nodes()->create<TFAvgPool>();
+ avgPool_node->name(node.name());
avgPool_node->data_layout(data_layout);
// padding
// tensorflow data_format: one of NHWC or NCHW.
auto data_layout = plier::tf::get_string_attr(node, "data_format");
auto tf_bias_add = graph->nodes()->create<TFBiasAdd>();
-
+ tf_bias_add->name(node.name());
tf_bias_add->data_layout(data_layout);
// To set the input node of encode_node with biasAdd_name
const int num_inputs = node.input_size() - 1;
std::vector<TensorName> input_names;
auto concat_node = graph->nodes()->create<TFConcatV2>(num_inputs);
+ concat_node->name(node.name());
for (int ni = 0; ni < num_inputs; ++ni)
{
// Create a "TFConstant" node for Const
auto const_node = graph->nodes()->create<TFConst>();
+ const_node->name(node.name());
// set dtype
auto dtype = plier::tf::as_loco_datatype(plier::tf::get_datatype_attr(node, "dtype"));
std::string conv2d_name = node.name();
auto conv2d = graph->nodes()->create<TFConv2D>();
+ conv2d->name(node.name());
// read attributes
auto data_layout = plier::tf::get_string_attr(node, "data_format");
std::string conv2d_backprop_name = node.name();
auto conv2d_backprop = graph->nodes()->create<TFConv2DBackpropInput>();
+ conv2d_backprop->name(node.name());
// read attributes
auto data_layout = plier::tf::get_string_attr(node, "data_format");
UpdateQueue *updates = context->updates();
auto depthwiseconv2d_native_node = graph->nodes()->create<TFDepthwiseConv2dNative>();
+ depthwiseconv2d_native_node->name(node.name());
// read attributes
auto data_layout = get_string_attr(node, "data_format");
UpdateQueue *updates = context->updates();
auto fakequant_node = graph->nodes()->create<TFFakeQuantWithMinMaxVars>();
+ fakequant_node->name(node.name());
// read optional attributes
if (has_attr(node, "num_bits"))
// creating TF dialect FusedBatchNorm node
auto tf_fbn = graph->nodes()->create<TFFusedBatchNorm>();
+ tf_fbn->name(node.name());
tf_fbn->epsilon(epsilon);
TensorName output_name(node.name(), 0);
// Create a Identity node
auto identity_node = graph->nodes()->create<TFIdentity>();
+ identity_node->name(node.name());
// register string-name to node
TensorName output_name(node.name(), 0);
// tensorflow data_format: one of NHWC or NCHW.
auto data_layout = plier::tf::get_string_attr(node, "data_format");
auto maxPool_node = graph->nodes()->create<TFMaxPool>();
+ maxPool_node->name(node.name());
maxPool_node->data_layout(data_layout);
// padding
// creating TF dialect Mean node
auto tf_mean = graph->nodes()->create<TFMean>();
+ tf_mean->name(node.name());
tf_mean->keep_dims(plier::tf::get_bool_attr(node, "keep_dims"));
TensorName output_name(node.name(), 0);
// creating TF dialect Mul node
auto tf_mul = graph->nodes()->create<TFMul>();
+ tf_mul->name(node.name());
TensorName output_name(node.name(), 0);
tensor_names->enroll(output_name, tf_mul);
// creating TF dialect Pad node
auto tf_pad = graph->nodes()->create<TFPad>();
+ tf_pad->name(node.name());
// register string-name to node
TensorName output_name(node.name(), 0);
// Create a "Placeholder" node as an input
auto placeholder_node = graph->nodes()->create<moco::TFPlaceholder>();
-
+ placeholder_node->name(node.name());
placeholder_node->dtype(dtype);
// Setting shape info.
// creating TF dialect RealDiv node
auto tf_div = graph->nodes()->create<TFRealDiv>();
+ tf_div->name(node.name());
TensorName output_name(node.name(), 0);
tensor_names->enroll(output_name, tf_div);
// Create a "TFRelu" node for Relu
auto relu_node = graph->nodes()->create<TFRelu>();
+ relu_node->name(node.name());
// register string-name to node
TensorName output_name(node.name(), 0);
// Create a "TFRelu6" node for Relu
auto relu_node = graph->nodes()->create<TFRelu6>();
+ relu_node->name(node.name());
// register string-name to node
TensorName output_name(node.name(), 0);
std::string reshape_name = node.name();
auto reshape = graph->nodes()->create<TFReshape>();
+ reshape->name(node.name());
// save the name for graph link updates
TensorName output_name(reshape_name, 0);
// creating TF dialect Rsqrt node
auto tf_rsqrt = graph->nodes()->create<TFRsqrt>();
+ tf_rsqrt->name(node.name());
// register string-name to node
TensorName output_name(node.name(), 0);
// create TF dialect Shape node
auto tf_shape = graph->nodes()->create<TFShape>();
+ tf_shape->name(node.name());
if (plier::tf::has_attrs(node, {"out_type"}))
{
// creating TF dialect Softmax node
auto tf_softmax = graph->nodes()->create<TFSoftmax>();
+ tf_softmax->name(node.name());
TensorName output_name(node.name(), 0);
tensor_names->enroll(output_name, tf_softmax);
// creating TF dialect Sqrt node
auto tf_sqrt = graph->nodes()->create<TFSqrt>();
+ tf_sqrt->name(node.name());
// register string-name to node
TensorName output_name(node.name(), 0);
// creating TF dialect SquaredDifference node
auto tf_sqdiff = graph->nodes()->create<TFSquaredDifference>();
+ tf_sqdiff->name(node.name());
// register string-name to node
TensorName output_name(node.name(), 0);
// creating TF dialect Squeeze node
auto tf_squeeze = graph->nodes()->create<TFSqueeze>();
+ tf_squeeze->name(node.name());
tf_squeeze->squeeze_dims(squeeze_dims);
TensorName output_name(node.name(), 0);
// creating TF dialect StopGradient node
auto tf_stopgradient = graph->nodes()->create<TFStopGradient>();
+ tf_stopgradient->name(node.name());
// register string-name to node
TensorName output_name(node.name(), 0);
// creating TF dialect Sub node
auto tf_sub = graph->nodes()->create<TFSub>();
+ tf_sub->name(node.name());
TensorName output_name(node.name(), 0);
tensor_names->enroll(output_name, tf_sub);
// creating TF dialect Tanh node
auto tf_tanh = graph->nodes()->create<TFTanh>();
+ tf_tanh->name(node.name());
// register string-name to node
TensorName output_name(node.name(), 0);
auto tfnode = output();
ASSERT_NE(tfnode, nullptr);
+ ASSERT_STREQ(tfnode->name().c_str(), _output);
int idx = 0;
ASSERT_EQ(tfnode->arity(), _inputs.size());