怎样在program中实时获取bn的mean和variance值
Created by: littletomatodonkey
如下所示,我想在bn之后获取当前的moving_mean和moving_variance的值(不是基于fetch list),再基于该值做一些额外的操作,想问下这个怎么实现呢?
temp_y = fluid.layers.batch_norm(
input=conv,
act=act,
param_attr=ParamAttr(name=bn_name + '_scale'),
bias_attr=ParamAttr(bn_name + '_offset'),
moving_mean_name=bn_name + '_mean',
moving_variance_name=bn_name + '_variance')
y = some_func(moving_mean, moving_variance, temp_y)