digraph G {
splines=ortho
rankdir=LR
feed_op[shape=circle,label="Feed Op\n\nPaddle"]
fetch_op[shape=circle,label="Fetch Op\n\nPaddle"]
mean_op[shape=circle,label="Mean Op\n\nPaddle"]
mean_grad_op[shape=circle,label="Mean Grad Op\n\nPaddle"]
conv_mkldnn[shape=circle,label="Conv Op\ndata_format=NHWC\n\nMKL-DNN"];
conv_grad_mkldnn[shape=circle,label="Conv Grad Op\ndata_format=NHWC\n\nMKL-DNN"];
pool_mkldnn[shape=circle,label="Pool Op\ndata_format=NHWC\n\nMKL-DNN"];
pool_grad_mkldnn[shape=circle,label="Pool Grad Op\ndata_format=NHWC\n\nMKL-DNN"];
tensor_mkldnn[shape=rectangle,label="Tensor conv op\nlayout=kMKLDNN\nNCHW dim format"]
tensor_pool_grad_mkldnn[shape=rectangle,label="Tensor Pool Grad op\nlayout=kMKLDNN\nNCHW dim format"]
tensor_conv_grad_mkldnn[shape=rectangle,label="Tensor Conv Grad op\nlayout=kMKLDNN\nNCHW dim format"]
tensor_mkldnn2[shape=rectangle,label="Tensor pool op\nlayout=kMKLDNN\nNCHW dim format"]
//tensor_input_data[shape=rectangle,label="Input Data\nlayout=kNCHW\nNCHW dim format"]
tensor_mean_grad_mkldnn[shape=rectangle,label="Tensor Grad mean\nlayout=kMKLDNN\nNCHW dim format"]
//tensor_fetch[shape=rectangle,label="Tensor Fetch_op\nlayout=kNCHW\nNHWC dim format"]
tensor_input_mean[shape=rectangle,label="Tensor pool op\nlayout=kNHWC\nNHWC dim format"]
tensor_output_mean[shape=rectangle,label="Tensor mean op\nlayout=kNHWC\nNHWC dim format"]
tensor_mean_grad[shape=rectangle,label="Tensor mean grad op\nlayout=kNHWC\nNHWC dim format"]
tensor_feed[shape=rectangle,label="Tensor feed_op\nlayout=kNCHW\nNHWC dim format"]
tensor_feed2[shape=rectangle,label="Tensor feed_op\nlayout=kMKLDNN\nNCHW dim format"]

feed_op -> tensor_feed -> tensor_feed2 -> conv_mkldnn -> tensor_mkldnn -> pool_mkldnn -> tensor_mkldnn2 -> tensor_input_mean -> mean_op 

mean_op -> tensor_output_mean

tensor_input_mean -> tensor_mean_grad[xlabel="InferShape", style=dashed]

tensor_output_mean -> mean_grad_op

mean_grad_op -> tensor_mean_grad -> tensor_mean_grad_mkldnn -> pool_grad_mkldnn -> tensor_pool_grad_mkldnn -> conv_grad_mkldnn -> tensor_conv_grad_mkldnn -> fetch_op 

{rank="same"  mean_op; mean_grad_op; tensor_output_mean}
{rank="same"  pool_mkldnn; pool_grad_mkldnn}
{rank="same"  conv_mkldnn; conv_grad_mkldnn}
{rank="same"  tensor_mean_grad; tensor_input_mean}
{rank="same" tensor_mkldnn2; tensor_mean_grad_mkldnn}
{rank="same" tensor_pool_grad_mkldnn; tensor_mkldnn}
{rank="same" tensor_conv_grad_mkldnn; tensor_feed}
{rank="same" fetch_op; feed_op}

//tensor_mkldnn2 -> tensor_mean_grad[label="Infer shape"]
}
