One-hot encoded data as an input to non convolutional NN

I’m writing a FFNN and have a problem with my one-hot encoded data.

The network should work with 28000 records of 1000 characters long strings encoded to 21 one-hot categories. The problem is that i want my model to be working on a tensor of size 1000x21, not on a one of a size 21000.

    self.fc1 = nn.Linear(input_size, hidden_size)
    self.fc2 = nn.Linear(hidden_size, hidden_size)
    self.fc3 = nn.Linear(hidden_size, output_size)

I want to utilize the above architecture with an input size of 1000x21.
I’m working with data loader, this is what i do to work with batches of data:

    x = x.view(x.size(0), -1) 
    x = self.fc1(x)

I’m not sure

    x = x.view(x.size(0), -1) 

would make sense here, as if it does have shape 21000 as you said, the view would result in a shape of 21000, 1 with this implementation.

If indeed 1000 is the correct batch dimension, then you would to specify at least one of the dimensions explicitly in the call to view (either 1000, or 21, or both).