nn.Upsample对不同维度tensor上采样

torch中,
我现在想把一个纬度为[bs, channel, depth, height, width]的3D tensor
通过nn.Upsample转换为
                 [bs, channel, depth, height*2, width*2]的tensor

则,init定义上采样是应为:

self.upsacle = nn.Upsample(scale_factor=tuple([1,2,2]))

2D及其他纬度以此类推。

参考:

https://blog.csdn.net/yangwangnndd/article/details/95490074

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章