Ai model integration

TypeError: empty() received an invalid combination of arguments - got (tuple, dtype=NoneType, device=NoneType), but expected one of:

  • (tuple of ints size, *, tuple of names names, torch.memory_format memory_format, torch.dtype dtype, torch.layout layout, torch.device device, bool pin_memory, bool requires_grad)
  • (tuple of ints size, *, torch.memory_format memory_format, Tensor out, torch.dtype dtype, torch.layout layout, torch.device device, bool pin_memory, bool requires_grad)
    i m getting this error for the code
    class IntentModel(nn.Module):
    def init(self, input_size, output_size):
    super(IntentModel, self).init()
    self.fc = nn.Linear(input_size, output_size)
    self.weight = torch.empty((output_size, input_size)) # Corrected initialization
    def forward(self, x):
    x = self.fc(x)
    return x

Could you post how input/output_size are defined?