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

Revert "Fix UserWarning: The torch.cuda.*DtypeTensor constructors are… #5165

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions accelerator/cuda_accelerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

# DeepSpeed Team

import functools
import os
import pkgutil
import importlib
Expand Down Expand Up @@ -261,31 +260,31 @@ def replay_graph(self, graph):

@property
def BFloat16Tensor(self):
return functools.partial(torch.tensor, dtype=torch.bfloat16, device='cuda')
return torch.cuda.BFloat16Tensor

@property
def ByteTensor(self):
return functools.partial(torch.tensor, dtype=torch.uint8, device='cuda')
return torch.cuda.ByteTensor

@property
def DoubleTensor(self):
return functools.partial(torch.tensor, dtype=torch.double, device='cuda')
return torch.cuda.DoubleTensor

@property
def FloatTensor(self):
return functools.partial(torch.tensor, dtype=torch.float, device='cuda')
return torch.cuda.FloatTensor

@property
def HalfTensor(self):
return functools.partial(torch.tensor, dtype=torch.half, device='cuda')
return torch.cuda.HalfTensor

@property
def IntTensor(self):
return functools.partial(torch.tensor, dtype=torch.int, device='cuda')
return torch.cuda.IntTensor

@property
def LongTensor(self):
return functools.partial(torch.tensor, dtype=torch.long, device='cuda')
return torch.cuda.LongTensor

def pin_memory(self, tensor, align_bytes=1):
return tensor.pin_memory()
Expand Down
Loading