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
ad678921
Unverified
Commit
ad678921
authored
Jul 29, 2022
by
Frank Lee
Committed by
GitHub
Jul 29, 2022
Browse files
[fx] patched torch.full for huggingface opt (#1386)
parent
527758b2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
colossalai/fx/tracer/meta_patch/patched_function/torch_ops.py
...ssalai/fx/tracer/meta_patch/patched_function/torch_ops.py
+6
-0
No files found.
colossalai/fx/tracer/meta_patch/patched_function/torch_ops.py
View file @
ad678921
...
...
@@ -132,3 +132,9 @@ def torch_tensor_repeat_interleave(self, repeats, dim=None, *, output_size=None)
@
meta_patched_function
.
register
(
torch
.
roll
)
def
torch_roll
(
input
,
shifts
,
dims
=
None
):
return
torch
.
empty
(
input
.
shape
,
device
=
'meta'
)
@
meta_patched_function
.
register
(
torch
.
full
)
def
torch_full
(
size
,
fill_value
,
*
,
out
=
None
,
dtype
=
None
,
layout
=
torch
.
strided
,
device
=
None
,
requires_grad
=
False
):
assert
out
is
None
,
'assigning result to out is not supported yet'
return
torch
.
empty
(
size
,
device
=
'meta'
,
dtype
=
dtype
,
layout
=
layout
,
requires_grad
=
requires_grad
)
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