Here you have a fully runnable script which fits exactly what you specified.
import torch
from torch import nn


class TempSigmoid(nn.Module):
    def __init__(self):
        super(TempSigmoid, self).__init__()  # writing super in python 2.7 (difference with python 3)
        self.nd =3.0


    def forward(self, x):
        temp = self.nd / torch.log(torch.tensor(0.9))
        return torch.sigmoid(x / (temp))

class MLP(nn.Module):
    def __init__(self):
        super(MLP, self).__init__()
        self.layers = nn.Sequential(
            nn.Linear(1024, 100),
            nn.Sigmoid(),
            nn.Linear(100, 8),
            # tempsigmoid()
            TempSigmoid()
        )

    def forward(self, x):
        x = self.layers(x)
        return x

N = 10
epochs = 1

inp= torch.rand(N*32,1934,1024)
gt= torch.rand(N*32,1934,8)
dataset = torch.utils.data.TensorDataset(inp,gt)
loader = torch.utils.data.DataLoader(
    dataset=dataset,
    batch_size = 32,
    shuffle=True,
    num_workers=0,
)
model = MLP()
loss_fn = torch.nn.L1Loss()
optimizer = torch.optim.SGD(model.parameters(),lr=0.1)
for epoch in range(epochs):
    model.train()
    for batch_idx, (x, y) in enumerate(loader):
        optimizer.zero_grad()
        outputs = model(x)
        loss = loss_fn(outputs, y)
        loss.backward()
        optimizer.step()
        print('Input shape: %r. Output shape %r' %(x.shape,outputs.shape))

Input shape: torch.Size([32, 1934, 1024]). Output shape torch.Size([32, 1934, 8])
Input shape: torch.Size([32, 1934, 1024]). Output shape torch.Size([32, 1934, 8])
Input shape: torch.Size([32, 1934, 1024]). Output shape torch.Size([32, 1934, 8])
Input shape: torch.Size([32, 1934, 1024]). Output shape torch.Size([32, 1934, 8])
Input shape: torch.Size([32, 1934, 1024]). Output shape torch.Size([32, 1934, 8])
Input shape: torch.Size([32, 1934, 1024]). Output shape torch.Size([32, 1934, 8])
Input shape: torch.Size([32, 1934, 1024]). Output shape torch.Size([32, 1934, 8])
Input shape: torch.Size([32, 1934, 1024]). Output shape torch.Size([32, 1934, 8])
Input shape: torch.Size([32, 1934, 1024]). Output shape torch.Size([32, 1934, 8])
Input shape: torch.Size([32, 1934, 1024]). Output shape torch.Size([32, 1934, 8])

I have to insist that if it’s not working you probably has any issue in your data. Mainly because linear layer takes a …,Q tensor and map it to a …,Q’.
Thus, the mistake is in the data or any line of code
Ofc, the suitability of the chosen architecture depends on what kinda data are you using.
In general the higher batch size, the better.
The thing is that, according to what you say here

My input is a handwriting number with 32x32 and has 1934 samples number. and my target data is 1934 samples with 8 bit so i need output with 1934 and 8 bit so i can compare and count loss with my target data.


I think Your input is not 1934,1024 but you have 1934 samples. That’s what’s not clear to me. Maybe it’s related to that.
Realize x and y (in your code) must be shape shape everywhere but the last dimension (depending on the loss you are using).
Can you print x.shape, y.shape, x_train.shape and y_train.shape