Unverified Commit ad678921 authored by Frank Lee's avatar Frank Lee Committed by GitHub
Browse files

[fx] patched torch.full for huggingface opt (#1386)

parent 527758b2
...@@ -132,3 +132,9 @@ def torch_tensor_repeat_interleave(self, repeats, dim=None, *, output_size=None) ...@@ -132,3 +132,9 @@ def torch_tensor_repeat_interleave(self, repeats, dim=None, *, output_size=None)
@meta_patched_function.register(torch.roll) @meta_patched_function.register(torch.roll)
def torch_roll(input, shifts, dims=None): def torch_roll(input, shifts, dims=None):
return torch.empty(input.shape, device='meta') 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)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment