Skip to content

Conversation

@lljbash
Copy link
Member

@lljbash lljbash commented Mar 29, 2024

Example:

import torch
import torch_dipu

torch.cuda.set_device(0)
a = torch.tensor([1, 2, 3]).cuda()
print(a)

Expected output:

tensor([1, 2, 3], device='cuda:0')

Current output (before this commit):

tensor([1, 2, 3], device='cuda')

Example:
```python
import torch
import torch_dipu

torch.cuda.set_device(0)
a = torch.tensor([1, 2, 3]).cuda()
print(a)
```

Expected output:
```
tensor([1, 2, 3], device='cuda:0')
```

Current output (before this commit):
```
tensor([1, 2, 3], device='cuda')
```
@lljbash lljbash added the bug Something isn't working label Mar 29, 2024
@lljbash lljbash self-assigned this Mar 29, 2024
self.assertEqual(str(a), "tensor([1, 2, 3])")
self.assertEqual(repr(a), "tensor([1, 2, 3])")

def test_cuda(self):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

device_index = 0

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@fandaoyi fandaoyi merged commit f84d3f8 into DeepLink-org:main Mar 29, 2024
@lljbash lljbash deleted the llj/fix-print-device-index branch April 1, 2024 02:27
xuq7410 pushed a commit to xuq7410/deeplink.framework that referenced this pull request May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants