Thank you so much. I have updated my code, I have a new error:
class CNN(torch.nn.Module):
    def __init__(self):
        super(CNN,self).__init__()
        self.conv1 = nn.Sequential(
            nn.Conv1d(708, 252, kernel_size=5, stride=1),  
            nn.Sigmoid(),
            nn.AvgPool1d(kernel_size=2, stride=2))
        self.conv2 = nn.Sequential(
            nn.Conv1d(252, 12, kernel_size=5, stride=1),
            nn.Sigmoid(),
            nn.AvgPool1d(kernel_size=2, stride=2))

        self.fc1 = nn.Linear(61, 12) 
        self.fc2 = nn.Linear(12, 4)

    def forward(self, x):
        out = self.conv1(x)
        out = self.conv2(out)
        out = self.fc1(out)
        out = self.fc2(out)
        return out

Error:
—> 24     loss_train = criterion(output_train, ytrain)
ValueError: Expected input batch_size (3) to match target batch_size (708).
These are the shapes. I am comparing them for the Cross Entropy Loss:
ytrain_shape torch.Size([708, 4])
Outputtrain shape torch.Size([3, 12, 4])