torch.backends.cudnn.enabled = False
np.random.seed(41)
torch.manual_seed(41)
torch.cuda.manual_seed(41)

model = models.models['alex_22']()
model.load_model()
net = model.cuda()

def get_input(n, c, h, w):
    return torch.randn(n, c, h, w)

load = True
# load = False
save_pth = 'tensors.pth' #'no_cudnn_tensors.pth'

saves = {}

if not load:
    a = get_input(1, 3, 127, 127)
    b = get_input(1, 3, 255, 255)
    saves['a'] = a
    saves['b'] = b
else:
    saves = torch.load(save_pth)
    a = saves['a']
    b = saves['b']

def Var(x):
    return Variable(x.cuda())

output = net(Var(a), Var(b))[1].data

b1 = net.forward_one_branch(Var(a), net.conv_r1, net.conv_cls1)[1].data
b2 = net.forward_one_branch(Var(b), net.conv_r2, net.conv_cls2)[1].data

f1 = net.features(Var(a)).data
f2 = net.features(Var(b)).data

if not load:
    saves['o'] = output
    saves['b1'] = b1
    saves['b2'] = b2
    saves['f1'] = f1
    saves['f2'] = f2
    torch.save(saves, save_pth)
    print 'saving'
else:
    o2 = saves['o']
    ob1 = saves['b1']
    ob2 = saves['b2']
    of1 = saves['f1']
    of2 = saves['f2']
    print (o2 - output).abs().max()
    print (b1 - ob1).abs().max()
    print (b2 - ob2).abs().max()
    print (f1 - of1).abs().max()
    print (f2 - of2).abs().max()


use this test code, I run on titan x and 1060,
output is
0.0687821805477
0.0696254000068
0.0968679785728
0.415367662907
0.437078356743
The difference is relative huge.
model part is two inputs feed in x, y,  (1,3,127, 127)->(256, 4, 4),  (1, 3, 255, 255) -> (255, 20, 20), and correlation two output.
features is a modified alexnet
class AlexNet5(nn.Module):
    def __init__(self):
        super(AlexNet5, self).__init__()
        self.conv1 = nn.Conv2d(3, 96, kernel_size=11, stride=2)
        self.conv2 = nn.Conv2d(96, 256, kernel_size=5)
        self.conv3 = nn.Conv2d(256, 384, kernel_size=3)
        self.conv4 = nn.Conv2d(384, 384, kernel_size=3)
        self.bn1 = nn.BatchNorm2d(96)
        self.bn2 = nn.BatchNorm2d(256)
        self.bn3 = nn.BatchNorm2d(384)
        self.bn4 = nn.BatchNorm2d(384)
        self.conv5 = nn.Conv2d(384, 256, kernel_size=3)
        self.bn5 = nn.BatchNorm2d(256)

        self.feature_size = 256

    def forward(self, x):
        x = F.relu(F.max_pool2d(self.bn1(self.conv1(x)), kernel_size=3, stride=2))
        x = F.relu(F.max_pool2d(self.bn2(self.conv2(x)), kernel_size=3, stride=2))
        x = F.relu(self.bn3(self.conv3(x)))
        x = F.relu(self.bn4(self.conv4(x)))
        x = self.bn5(self.conv5(x))
        return x