You can initialize the buffers as tensors and reuse them.
Note that you have to take care of storing and using the parameters as well as buffers, if you don’t want to use nn.Modules, which would store them internally.
Here is a small example:
# Create parameters and buffers
weight = nn.Parameter(torch.ones(3))
bias = nn.Parameter(torch.zeros(3))
running_mean = torch.zeros(3)
running_var = torch.ones(3)

# Pass parameters to optimizer
optimizer = torch.optim.SGD([weight, bias], lr=1.)

# Execute for and backward
input = torch.randn(2, 3, 24, 24)
out = F.batch_norm(input, running_mean, running_var, weight, bias, training=True)
out.mean().backward()
optimizer.step()

# buffers were updated
print(running_mean)
print(running_var)