Skip to content

making slicing from torch.fx scriptable #43511

@jerryzh168

Description

@jerryzh168

======================================================================
ERROR: test_torchvision (quantization.test_quantize_fx.TestQuantizeFxModels)

Traceback (most recent call last):
File "/data/users/jerryzh/pytorch/test/quantization/test_quantize_fx.py", line 828, in test_torchvision
script = torch.jit.script(graph_module)
File "/data/users/jerryzh/anaconda3/envs/py3/lib/python3.7/site-packages/torch/jit/_script.py", line 888, in script
obj, torch.jit._recursive.infer_methods_to_compile
File "/data/users/jerryzh/anaconda3/envs/py3/lib/python3.7/site-packages/torch/jit/_recursive.py", line 317, in create_script_module
return create_script_module_impl(nn_module, concrete_type, stubs_fn)
File "/data/users/jerryzh/anaconda3/envs/py3/lib/python3.7/site-packages/torch/jit/_recursive.py", line 376, in create_script_module_impl
create_methods_from_stubs(concrete_type, stubs)
File "/data/users/jerryzh/anaconda3/envs/py3/lib/python3.7/site-packages/torch/jit/_recursive.py", line 292, in create_methods_from_stubs
concrete_type._create_methods(defs, rcbs, defaults)
RuntimeError:

slice(Tensor 0, Tensor 1, Tensor 2) -> (Tensor 0):
Expected a value of type 'Tensor' for argument '0' but instead found type 'None'.
:
def forward(self, x):
self = self.root
getitem = x[(slice(None, None, None), 0)]
~~~~~ <--- HERE
unsqueeze_1 = torch.unsqueeze(getitem, 1)
mul_1 = unsqueeze_1 * 0.458


Ran 1 test in 1.208s

FAILED (errors=1)

cc @gmagogsfm

Metadata

Metadata

Assignees

Labels

oncall: jitAdd this issue/PR to JIT oncall triage queuetriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions