赞
踩
最近遇到代码中的一个warining, UserWarning: nn.functional.upsample is deprecated. Use nn.functional.interpolate instead.
warnings.warn("nn.functional.upsample is deprecated. Use nn.functional.interpolate instead.")
然后看到一个人的提问,“
I just need a layer, not a function.
If nn.Upsample is deprecated, i cannot find any layer to replace it.
F.upsample and F.interpolate may be similar, but there is no nn.Interpolate, and I don’t know why.
”让我这个平时没有特别区别function和layer的用法的人一愣。。。
You could probably just wrap F.interpolate
into a nn.Module
ans still use it in your sequential model. Have a look at this for an example.
class Interpolate
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。