paddle转换报错
收藏
报错 'paddle.fluid.core_avx.VarType' object is not callable
p_n = p_n.view(1, 2*N, 1, 1).type(dtype)
应该如何复现
0
收藏
请登录后评论
pytorh版本:p_n = p_n.view(1, 2*N, 1, 1).type(dtype)
paddle版本:p_n = fluid.layers.reshape(x=p_n, shape=[1, 2*N, 1, 1]).type(dtype)
改为
p_n = fluid.layers.reshape(x=p_n, shape=[1, 2*N, 1, 1])
p_n = fluid.layers.cast(p_n, dtype)
2.0后逐渐不用fluid下的api了,可以参考新版本文档
https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/tensor/manipulation/reshape_cn.html#reshape
试试 paddle.reshape 吧,版本得2.0以上