I have been working on a university project where I stuck on one point. I want to know what is the general approach to writing logistic regression in PyTorch? I have written some code here which I guess working fine.

Code:

```
class LogisticRegression(torch.nn.Module):
"""
Logistic regression model
inherits the torch.nn.Module which is the base class
for all neural network modules.
"""
def __init__(self, input_dim, output_dim):
""" Initializes internal Module state. """
super(LogisticRegression, self).__init__()
# TODO define linear layer for the model
self.linear = torch.nn.Linear(input_dim,output_dim)
def forward(self, x):
""" Defines the computation performed at every call. """
# What are the dimensions of your input layer?
# TODO flatten the input to a suitable size for the initial layer
output = self.linear(x)
# TODO run the data through the layer
return outputs
```

There are two additional questions that I do not understand:

What are the dimensions of your input layer? and how to find it?

Run the data through the layer. How to run data through the layer? and

Flatten the input to a suitable size for the initial layer?

Thanks in advance.