What I do is to use a hook to inspect the input and output to the batchnorm layer, and I compute the mean and variance of the input to the layer (which should be roughly the same to the one computed by torch._C._functions.BatchNorm).
Example:
# 1. define model
model = ...

# 2. register the hook
model.bn_layer.register_forward_hook(printbn)

# 3. the hook function will be called here
model.forward(...)

and the hook can be defined as:
def printbn(self, input, output):
    print('Inside ' + self.__class__.__name__ + ' forward')
    mean = input[0].mean(dim=0)
    var = input[0].var(dim=0)
    print(mean)