Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running stack ghci on hasktorch directory gives an error. #674

Open
noahmartinwilliams opened this issue Jun 11, 2023 · 3 comments
Open

Comments

@noahmartinwilliams
Copy link
Contributor

When I run "stack ghci hasktorch" I get the following error:

/home/noah/src/package-sources/hasktorch/hasktorch/src/Torch/Typed/Tensor.hs:101:16: error:
    • Expected kind ‘dtype’, but ‘Bool’ has kind ‘*’
    • In the first argument of ‘ComputeDType’, namely ‘Bool’
      In the type family declaration for ‘ComputeDType’
    |
101 |   ComputeDType Bool = D.Bool
    |                ^^^^
Failed, 42 modules loaded.

<no location info>: error:
    Could not load module ‘Torch.Distributions.Bernoulli’
    It is a member of the hidden package ‘hasktorch-0.2.0.0’.
    You can run ‘:set -package hasktorch’ to expose it.
    (Note: this unloads all the modules in the current scope.)
Loaded GHCi configuration from /tmp/haskell-stack-ghci/4fb18ce4/ghci-script
@junjihashimoto
Copy link
Member

@noahmartinwilliams Which version of ghc version are you using?

@noahmartinwilliams
Copy link
Contributor Author

9.0.2

@andreasabel
Copy link
Contributor

andreasabel commented Oct 15, 2023

I am experiencing a more basic error (macOS 12):

$ stack repl examples:exe:autograd
Using main module:
1.  Package examples, component examples:exe:autograd, with main-is file: /Users/abel/bin/src/hasktorch/examples/autograd/Main.hs.

Configuring GHCi with the following packages: examples.
GHCi, version 9.2.8: https://www.haskell.org/ghc/  :? for help
<command line>: cannot satisfy -package z-examples-z-static-mnist
    (use -v for more information)
<<EXITS>>

I see that examples/examples.cabal has an internal library static-mnist, so maybe this is a problem that internal libraries aren't supported so well yet by the Haskell tooling?

This could be:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants