Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
ColossalAI
Commits
c198c7c0
Unverified
Commit
c198c7c0
authored
Jan 29, 2023
by
Super Daniel
Committed by
GitHub
Jan 29, 2023
Browse files
[hotfix] meta tensor default device. (#2510)
parent
077a5cdd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
colossalai/fx/profiler/tensor.py
colossalai/fx/profiler/tensor.py
+1
-1
No files found.
colossalai/fx/profiler/tensor.py
View file @
c198c7c0
...
...
@@ -43,7 +43,7 @@ class MetaTensor(torch.Tensor):
storage_offset
=
elem
.
storage_offset
(),
dtype
=
elem
.
dtype
,
layout
=
elem
.
layout
,
device
=
fake_device
if
fake_device
is
not
None
else
torch
.
device
(
'cpu'
),
device
=
fake_device
or
(
elem
.
device
if
elem
.
device
.
type
!=
'meta'
else
torch
.
device
(
'cpu'
)
)
,
requires_grad
=
elem
.
requires_grad
)
# deceive the frontend for aten selections
r
.
_tensor
=
elem
# ...the real tensor is held as an element on the tensor.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment