Solved by spanev in post #2 
              
              
                Hi @harishkool, 
Here the graph built by autograd will represent only " y = mat . inpt". 
That’s because mat = Variable(torch.Tensor([1,cosval,cosval])) is a leaf node (think that mat creation torch.Tensor([1,cosval,cosval] is not a differentiable operation). 
Also Variable is deprecated and you sho…