Answers for "derivative of multivariable function pytorch"

0

derivative of multivariable function pytorch

import torch

x = torch.autograd.Variable(torch.Tensor([2]),requires_grad=True)
y = 5*x**4 + 3*x**3 + 7*x**2 + 9*x - 5

y.backward()
x.grad
Posted by: Guest on February-04-2021

Python Answers by Framework

Browse Popular Code Answers by Language