this is my example! I finally reproduced it!
import torch
import torch.nn as nn
from torch.autograd import Variable
import numpy as np

class Fnn2D3(nn.Module):
    def __init__(self,input_dim, hidden_dim, dp_ratio):
        super(Fnn2D3,self).__init__()
        self.out = nn.Sequential(
            nn.Dropout(dp_ratio),
            nn.Linear(input_dim, hidden_dim,bias=False),
            nn.ReLU(),
            nn.Dropout(dp_ratio),
            nn.Linear(hidden_dim, hidden_dim,bias=False),
            nn.ReLU())
     
    def forward(self, inputs):
        a,b,c = inputs.size()
        inputs = inputs.view(-1,c)
        outputs = self.out(inputs)
        outputs = outputs.view(a,b,-1)
        return outputs
    
    
class Mlp2(nn.Module):
    def __init__(self,input_dim, hidden_dim, output_dim,dp_ratio):
        super(Mlp2,self).__init__()
        self.out = nn.Sequential(
            nn.Dropout(dp_ratio),
            nn.Linear(input_dim,hidden_dim,bias=False),
            nn.ReLU(),
            nn.Dropout(dp_ratio),
            nn.Linear(hidden_dim,output_dim,bias=False)
        )
        
    def forward(self, inputs):
        return self.out(inputs)
class Example(nn.Module):
    def __init__(self):
        super(Example,self).__init__()
        self.cmp1 = Fnn2D3(600,200,0.2)
        self.cmp2 = Fnn2D3(600,200,0.2)
        self.mlp = Mlp2(400,200,3,0.2)
    
    def forward(self,a,b,c,d):
        a = self.cmp1(torch.cat((a, c), 2))
        b = self.cmp2(torch.cat((b, d), 2))
        
        a = torch.mean(a,1)
        b = torch.mean(b,1)
        print a.size()
        print b.size()
        # hypo_mpool:(batch,1,cmp_dim),prem_mpool..
        out = self.mlp(torch.cat((a,b), -1).view(5,-1))
        
        return out
    
a = Variable(torch.randn(5,30,300))
b = Variable(torch.randn(5,23,300))
c = Variable(torch.randn(5,30,300))
d = Variable(torch.randn(5,23,300))
e = Variable(torch.from_numpy(np.array([1,0,1,2,1])))

opt = O.Adagrad(model.parameters(),lr=config["lr"],)

model = Example()
output = model(a,b,c,d)
print output.size()
criterion = nn.CrossEntropyLoss()


loss = criterion(output,e)
print loss
loss.backward()
opt.step()