【论文复现】paddle如何定义可训练的数组
Created by: chunfeng0301
img_grad = nn.Parameter(torch.FloatTensor([[[[-0.5,0,0.5]]]]).repeat(32,32,1,1)) 如上用paddle如何实现 f_grad = (np.array([[[[-0.5,0,0.5]]]]).astype("float32").repeat(32**2,1))#fluid.layers.create_parameter
f_grad2 = fluid.dygraph.to_variable(f_grad)报如下错误
"We Only support %s in Dygraph mode, please use fluid.dygraph.guard() as context to run it in Dygraph Mode" % func.name AssertionError: We Only support to_variable in Dygraph mode, please use fluid.dygraph.guard() as context to run it in Dygraph Mode
use fluid.dygraph.guard() 能进行训练么??对么