Something like the following should work. There might be some errors as I didn’t look up the exact API, but those should be easy to fix.
class ABN2d(nn.Module):
  def __init__(self):
    super().__init__()
    self.bn = nn.BatchNorm2d(affine = False)
    self.register_parameter('a', Variable(torch.*Tensor(1, 1, 1, 1), requires_grad = True))
    self.register_parameter('b', Variable(torch.*Tensor(1, 1, 1, 1), requires_grad = True))

  def forward(self, x):
    return a * x + b * self.bn(x)