Oh, I’m doing what you say, but the results aren’t working. But there is something I overlooked. I thought there was a problem in batchnorm, but it was confirmed that the problem occurred from the convolution above it.
model.features[1].register_forward_hook(get_activation('features'))
data, _ = val_data[num]
data.unsqueeze_(0)
output = model(data)
print("activation[features]")
print(activation['features'])
print(activation['features'].shape)

m = model.features[1]
conv1 = F.conv2d(cifar, m.weight, bias=m.bias, stride=1)
print(conv1)

activation['features'] and  conv1 are different.
The results in the middle of the model and the results directly performed with parameters are different.
If so, is it possible that the binarizeconv2d used in the model is wrong??
Or am I using convolution the wrong way too?
sorry to keep asking T_T