Solved by ptrblck in post #2 
              
              
                If no parameters in the operations require a gradient, you won’t get a grad_fn. 
You could set requires_grad=True e.g. for x, which will give you a valid grad_fn in x_trans.