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.
__init__
forward