I have a polynomial and I need to evaluate it element-wise across a tensor.

For example f(x) = ax^3 + bx^2 +cx + d for some [a,b,c,d].

[a,b,c,d] are constants.

Is this possible with pytorch?

I have a polynomial and I need to evaluate it element-wise across a tensor.

For example f(x) = ax^3 + bx^2 +cx + d for some [a,b,c,d].

[a,b,c,d] are constants.

Is this possible with pytorch?

You mean like `x**arange(coeffs.size(0)-1, -1, -1)*coeffs`

when `coeffs = torch.tensor([a,b,c,d])`

?

Best regards

Thomas

yeah, like that!

thanks