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

The code runs well on Linux, but with error on windows. #40

Open
Zzzyf98 opened this issue Dec 4, 2022 · 1 comment
Open

The code runs well on Linux, but with error on windows. #40

Zzzyf98 opened this issue Dec 4, 2022 · 1 comment

Comments

@Zzzyf98
Copy link

Zzzyf98 commented Dec 4, 2022

The code runs well in Linux, but with errors in windows.

Here is the code and error message:
`t = tn.rand((3,3,3,3,3,3))
print(t)

t = tn.cross(function=lambda x: x**2, tensors=[t])
print(t)`

Traceback (most recent call last):
File "C:\Users\4\PycharmProjects\TTALS\test.py", line 22, in
t = tn.cross(function=lambda x: x ** 2, tensors=[t])
File "C:\Users\4\anaconda3\lib\site-packages\tntorch\cross.py", line 261, in cross
ys_val = f([t[Xs_val].torch() for t in tensors])
File "C:\Users\4\anaconda3\lib\site-packages\tntorch\cross.py", line 261, in
ys_val = f(
[t[Xs_val].torch() for t in tensors])
File "C:\Users\4\anaconda3\lib\site-packages\tntorch\tensor.py", line 1019, in getitem
factors['index'] = get_key(counter, key[i])
File "C:\Users\4\anaconda3\lib\site-packages\tntorch\tensor.py", line 933, in get_key
return self.cores[counter][..., key, :]
IndexError: tensors used as indices must be long, byte or bool tensors

I change the "key" to 0, and the error is gone. So the problem may be the "key".
The problem only occurs on Windows.

@rballester
Copy link
Owner

Hi, are the NumPy and PyTorch versions the same and up-to-date in both environments?

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

2 participants