import torch
import torch.nn as nn
device = torch.device(\'cuda\' if torch.cuda.is_available() else
\'cpu\')
class Model(nn.Module):
def __init__(self):
please look carefully at the indentation of your __init__
function: your forward
is part of __init__
not part of your module.
This error happens when you don't implement the required method from super class, in my case, i had typo on the function name forward. I recommend you check your code indentation.