关于torch与paddle的对应api
Created by: lxk767363331
avgout = torch.mean(x, dim=1, keepdim=True)=== avg_out = fluid.layers.reduce_mean(input, dim=1, keep_dim=True)
maxout, _ = torch.max(x, dim=1, keepdim=True)===max_out = fluid.layers.reduce_max(input, dim=1, keep_dim=True)
out = self.ca(out) * out # 广播机制=====conv=ChannelAttention(conv,num_filters=num_filters,ratio=4)*conv out = self.sa(out) * out # 广播机制===== conv=SpatialAttention(conv,num_filters=num_filters,)*conv
torch中代码对应地方api我这样设置但是有些问题