How to Solve NameError: name 'nn' is not defined -- torch
Solution: Import the 'nn' module
# Add the following line to the top of your code
from torch import nn
For more information:
torch nn
# Add the following line to the top of your code
from torch import nn
For more information:
torch nn