import torch
import torch.nn as nn
import torch.nn.functional as F
class  CharCNN(nn.Module):
def init(self):
super(CharCNN, self).init()
self.conv1 = nn.Sequential(
nn.Conv1d(num_channels, depth_1, kernel_size=kernel_size_1, stride=stride_size),
nn.ReLU(),
nn.MaxPool1d(kernel_size=kernel_size_1, stride=stride_size),
nn.Dropout(0.1),
)
    self.conv2 = nn.Sequential(
        nn.Conv1d(depth_1, depth_2, kernel_size=kernel_size_2, stride=stride_size),
        nn.ReLU(),
        nn.MaxPool1d(kernel_size=3, stride=3),
        nn.Dropout(0.25)
    )            
        
         
    self.fc1 = nn.Sequential(
        nn.Linear(depth_2*kernel_size_2, num_hidden),
        nn.ReLU(),
        nn.Dropout(0.5)
    )
    
    self.fc2 = nn.Sequential(
        nn.Linear(num_hidden, 11),
        nn.ReLU(),
        nn.Dropout(0.5)
    )
    
    

def forward(self, x):
    x = self.conv1(x)
    x = self.conv2(x)

    # collapse
    x = x.view(x.size(0), -1)
    # linear layer
    x = self.fc1(x)
    # output layer
    x = self.fc2(x)
    x = self.log_softmax(x)
    
    return x

Hello,
I am trying to train this network in pytorch. I am litlle confused regarding the training of 1D CNN network. We generally make train and test loaders in pytorch. But i want to train my network without data loader. Please help me how i can train this network.