The problem with this approach is that the resulting tensor bias is not a parameter:
bias_for_optim=nn.Parameter(torch.zeros(topology[idx+1],).cuda())
bias=bias_for_optim.repeat(batch,1)
print type(bias)

and cannot be registered in the module. Shoud I put into nn.Parameter  again after repeat?