Commit 04bbc81f authored by Yanghan Wang's avatar Yanghan Wang Committed by Facebook GitHub Bot
Browse files

force contiguous when calling `augment_model_with_bundled_inputs`

Summary: `augment_model_with_bundled_inputs` can compress the tensor when values are constant, however it requires contiguous layout and `zero_like` can return non-contiguous ones

Reviewed By: zhanghang1989

Differential Revision: D28224987

fbshipit-source-id: 32b13728ff8fadd53412dbf2d59c4b46e92af04a
parent e1961ad4
......@@ -85,7 +85,7 @@ def trace_and_save_torchscript(
iters = recursive_iterate(inputs)
for x in iters:
if isinstance(x, torch.Tensor):
iters.send(torch.zeros_like(x))
iters.send(torch.zeros_like(x).contiguous())
inputs = iters.value
augment_model_with_bundled_inputs(liteopt_model, [inputs])
liteopt_model.run_on_bundled_input(0) # sanity check
......
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