I’m not sure I understand the question correctly.
Most nn.Modules expect an input with the batch dimension in dim0 (RNNs are an exception in the default setup).
Your current error seems to be raised, as it seems network is a class definition and not the model instance.
If that’s the case, you would have to create an instance via:
class network(nn.Module):
    ...

model = network()
...
output = model(data)

PS: You can post code snippets by wrapping them into three backticks ```, which makes debugging easier.