我试图使用pytorch计算三角函数,但在通过函数调用它时遇到问题,下面是我的代码:-
def func(x,y):
return torch.exp(torch.sin(x)/x-y)
func(torch.tensor[2,3])
Error:-
TypeError - Traceback (most recent call last)
<ipython-input-16-beb818f912f5> in <module>()
----> 1 func(torch.tensor([2, 3]))
TypeError: newf() missing 1 required positional argument: 'y'
调用函数时,此代码中有什么错误
您需要打开包装:
相关问题 更多 >
编程相关推荐