[PT FE] Return dynamic shape when static shape exist in graph (#20289)

This commit is contained in:
Maxim Vafin 2023-10-10 07:59:46 +02:00 committed by Alexander Nesterov
parent 571b41e383
commit a31ed6ad19

View File

@ -169,7 +169,8 @@ class TorchScriptPythonDecoder (Decoder):
def get_shape_for_value(self, value: torch.Value):
if value.isCompleteTensor():
ps = PartialShape(value.type().sizes())
# We avoid static shapes, they don't generalize on other inputs
ps = PartialShape([-1] * len(value.type().sizes()))
return ps
else:
# TODO: Recognize types that we can represent as a nested constructs with objects from DecoderType