GithubHelp home page GithubHelp logo

Comments (8)

ianyfan avatar ianyfan commented on July 17, 2024

Try setting torch.set_default_tensor_type(torch.FloatTensor) or torch.set_default_tensor_type(torch.cuda.FloatTensor) at the start of your script?

from lambeq.

dimkart avatar dimkart commented on July 17, 2024

Hello @srinjoyganguly and thanks for reporting this. @ianyfan has already responded what we think might be the problem, let us know if this works for you.

from lambeq.

srinjoyganguly avatar srinjoyganguly commented on July 17, 2024

Hi @ianyfan thank you so much for the help! I tried using the lines you gave at the start of my script but still getting the same issue. The same error persists. I realized that this line - torch.set_default_tensor_type(torch.cuda.FloatTensor) already existed in my code and I was getting the error. I tried with - torch.set_default_tensor_type(torch.FloatTensor) but the error is still the same. Are there any other ways?

@dimkart you are very welcome! Thank you a lot!

from lambeq.

dimkart avatar dimkart commented on July 17, 2024

Hi @srinjoyganguly, can you send us your notebook/code in [email protected] (or post it here), so we can have a better look? It's really difficult to say what is going on just from the error message.

from lambeq.

ianyfan avatar ianyfan commented on July 17, 2024

Changing the line to

torch.set_default_tensor_type(torch.cuda.DoubleTensor)

should allow the notebook to run, though we are working on a proper fix on the underlying code.

from lambeq.

srinjoyganguly avatar srinjoyganguly commented on July 17, 2024

Indeed @ianyfan the code works with DoubleTensor! Thank you so much for the help! I look forward to the proper fix in the underlying code! Thanks a lot @ianyfan and @dimkart !

from lambeq.

dimkart avatar dimkart commented on July 17, 2024

Thanks for pointing this out @srinjoyganguly. We have updated the notebook to use a double tensor until we fix this in DisCoPy. This issue will be now closed.

from lambeq.

srinjoyganguly avatar srinjoyganguly commented on July 17, 2024

You are very welcome @dimkart ! I am glad, thanks so much!

from lambeq.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.