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

Wrong device in ttv_tensor.py bug fixed #16

Merged
merged 12 commits into from
Dec 18, 2023
4 changes: 2 additions & 2 deletions pyCP_APR/torch_backend/ttv_sptensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ def ttv(M, vecs, dims=[]):
product of KRUSKAL tensor X with a (column) vector vecs.
"""

dims = tr.arange(M.Dimensions)
vidx = tr.arange(M.Dimensions)
dims = tr.arange(M.Dimensions).to(M.device)
vidx = tr.arange(M.Dimensions).to(M.device)

combined = tr.cat((dims, vidx))
uniques, counts = combined.unique(return_counts=True)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
description='pyCP_APR: CP-APR Tensor Decomposition with PyTorch Backend.',
long_description=LONG_DESCRIPTION,
long_description_content_type='text/markdown',
package_dir={'pyCP_APR': 'pyCP_APR/'},
package_dir={'pyCP_APR': 'pyCP_APR'},
platforms = ["Linux", "Mac", "Windows"],
include_package_data=True,
setup_requires=[
Expand Down
Loading