mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-29 20:14:01 +00:00
bug fix for symbolic shape infer (#13067)
This commit is contained in:
parent
65c67764ae
commit
c4a52820a5
1 changed files with 8 additions and 1 deletions
|
|
@ -41,6 +41,13 @@ def get_shape_from_type_proto(type_proto):
|
|||
return None # note no shape is different from shape without dim (scalar)
|
||||
|
||||
|
||||
def get_elem_type_from_type_proto(type_proto):
|
||||
if is_sequence(type_proto):
|
||||
return type_proto.sequence_type.elem_type.tensor_type.elem_type
|
||||
else:
|
||||
return type_proto.tensor_type.elem_type
|
||||
|
||||
|
||||
def get_shape_from_value_info(vi):
|
||||
cls_type = vi.type.WhichOneof("value")
|
||||
if cls_type is None:
|
||||
|
|
@ -570,7 +577,7 @@ class SymbolicShapeInference:
|
|||
vi.CopyFrom(
|
||||
helper.make_tensor_value_info(
|
||||
node.output[0],
|
||||
self.known_vi_[node.input[0]].type.tensor_type.elem_type,
|
||||
get_elem_type_from_type_proto(self.known_vi_[node.input[0]].type),
|
||||
self._get_shape(node, 0),
|
||||
)
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in a new issue