Skip to content
Discussion options

You must be logged in to vote

Hi,

To me it seems you made a mistake in your LinearRegressionModel class:

class LinearRegressionModel(nn.Module): # -> almost everything in Pytorch inherhits from nn.Module
    def _init_(self):
        super()._init_()

Should be

class LinearRegressionModel(nn.Module): # -> almost everything in Pytorch inherhits from nn.Module
    def __init__(self): # <- notice the "__" on each side
        super().__init__() # <- notice the "__" on each side

You forgot using __ (double underscores).

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@mrdbourke
Comment options

Answer selected by mrdbourke
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants