Solved by kenmikanmi in post #2 
              
              
                Hi, I guess your model will be like: 
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable

class YourModel(nn.Module):
    def __init__(self):
        super(YourModel, self).__init__()
        self.lin1 = nn.Linear(5, 5)
        self.lin2 = nn.Linea…