1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

  2. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[Python] Pytorch function calling

Discussão em 'Python' iniciado por Stack, Setembro 21, 2021.

  1. Stack

    Stack Membro Participativo

    I am trying to compute a trignometric function using pytorch, but having issues while calling it via function, below is my code:-

    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'


    What is incorrect in this code while calling the function?

    Continue reading...

Compartilhe esta Página