Solved 
class Conv1D(nn.Module):
    def __init__(self, input_dim, output_dim, num_features, seq_length, batch_size, iter_dim, dropout): 
        super(Conv1D, self).__init__()
        self.input_dim = input_dim              # number of features of dataX = 6, 18 or 55
        self.output_dim = output_dim            # 4
        self.num_features = num_features        # 64
        self.seq_length = seq_length
        self.batch_size = batch_size            # 128
        self.iter_dim = iter_dim                # 0
        self.dropout = nn.Dropout(dropout)
        self.relu = nn.ReLU()
        self.softmax = nn.Softmax(dim=1)
        self.conv1 = nn.Conv1d(input_dim, num_features, kernel_size = 9, padding = 4)  # padding = 8)
        self.bn1 = nn.BatchNorm1d(num_features)
        self.conv2 = nn.Conv1d(num_features, num_features, kernel_size = 5, padding = 2)  # padding = 5)
        self.bn2 = nn.BatchNorm1d(num_features)
        self.conv3 = nn.Conv1d(num_features, num_features * 2, kernel_size = 3, padding = 1)  # padding = 3)
        self.bn3 = nn.BatchNorm1d(num_features * 2)
        self.avgpool = nn.AvgPool1d(seq_length, padding = 0)
        self.linear1 = nn.Linear(num_features * 2, num_features)
        self.linear2 = nn.Linear(num_features, output_dim)
        
    def forward(self, x_t):
        x_t = self.conv1(x_t)
        x_t = self.bn1(x_t)
        x_t = self.relu(x_t)
        for layer in range(self.iter_dim-2):
            x_t = self.conv2(x_t)
            x_t = self.bn2(x_t)
            x_t = self.relu(x_t)
        x_t = self.conv3(x_t)
        x_t = self.bn3(x_t)
        x_t = self.relu(x_t)
        x_t = self.avgpool(x_t)
        x_t = x_t.view(x_t.shape[0],-1)
        #x_t = x_t.view(-1)
        x_t = self.linear1(x_t)
        x_t = self.dropout(x_t)
        x_t = self.relu(x_t)
        x_t = self.linear2(x_t)
        x_t = self.softmax(x_t)
        return x_t