Solved by InnovArul in post #2 
              
              
                This works for me. 
import torch
import numpy as np
import torch.utils.data as data

class model(torch.nn.Module):
    def __init__(self, D_in, H):
        super(model,self).__init__()
        self.transfer = torch.nn.Sigmoid()
        self.lin1 = torch.nn.Linear(D_in, H)
        self.lin2 = torch.n…