For 0.3 version, I want to add a learnable parameter like "self.scale = nn.Parameter(torch.tensor([10.0]), requires_grad=True) in nn.Module. But it throws an error, TypeError: ‘module’ object is not callable. If I use a tensor, torch.FloatTensor([10.0]), it is not learnable, right?
class PreActBottleneck(nn.Module):
def init(self, inplanes, planes, stride=1, downsample=None):
super(PreActBottleneck, self).init()
self.conv1 = nn.Conv2d(inplanes, planes, kernel_size=1, bias=False)
self.scale = nn.Parameter(torch.tensor([10.0]), requires_grad=True)