I have a model with u(x,t) and i am training my model with x[100,1] and t[100,1] as tensor [100,2] to predict the u(x,t). I need to find the partial derivative of u wrt to t and double differential wrt to x to solve the PDE. I am stuck how to go for this part. I tried this piece of code. **’’’ u_pred = pn(y) f_pred = differential(u_pred,x,t) def differential(u_pred,x,t): f =  for i in range(len(x)+1):
dt = torch.autograd.grad(u_pred[i], t[i],allow_unused=True) dx = torch.autograd.grad(u_pred[i], x[i], create_graph=True) ddx = torch.autograd.grad(dx, x) f_i = ddx - dt f = np.append(f,f_i) return f
‘’’** Please help me.