What is nn Module in PyTorch?

nn module : The nn package define a set of modules, which are thought of as a neural network layer that produce output from the input and have some trainable weights.
 
It is a type of tensor that considers a module parameter. Parameters are tensors subclasses. A fully connected ReLU networks where one hidden layer, trained to predict y from x to minimizing the square distance.
 
Example :
Import torch
# define mode1
model= torch.nn.Sequential(
torch.nn.Linear(hidden_num_units, hidden_num_units),
torch.nn.ReLU( ),
torch.nn.Linear(hidden_num_units, output_num_units),
)
loss_fn= torch.nn.crossEntropyLoss( )