prune把最后inplace的op剪掉了
Created by: oraoto
import paddle.fluid as fluid
import paddle
from paddle.fluid.debugger import draw_block_graphviz
x = fluid.layers.data(name='x', shape=[1], dtype='float32', lod_level=1)
y = fluid.layers.fc(x, size=2, bias_attr=False, act='relu')
y = fluid.layers.fc(y, size=3, bias_attr=False, act='relu')
draw_block_graphviz(fluid.default_main_program().block(0), path="m.pdf")
pruned = fluid.default_main_program().prune(y)
draw_block_graphviz(pruned.block(0), path="g.pdf")
剪枝前:
剪枝后,最后一个relu没了: