-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Closed
Labels
Description
Bug Report
Currently, shape inference for Reshape intentionally does not succeed for dynamic shapes. In cases where the "shape" parameter has an inferred shape that is a value (and not a symbolic param), we can determine the output rank.
Currently, however shape inference does not succeed does not currently happen.
In the provided example copied in below, we should be able to infer a shape of (None, None)
rather than just None
.
def test_reshape_dynamic_shape(self) -> None:
graph = self._make_graph(
[("x", TensorProto.UINT8, (2, 4, 3)), ("shape", TensorProto.INT64, (2,))],
[make_node("Reshape", ["x", "shape"], ["y"])],
[],
)
self._assert_inferred(
graph, [make_tensor_value_info("y", TensorProto.UINT8, None)]
)
If "shape"
is either None
(i.e. shape cannot be inferred) or it is symbolic (e.g. ("M",)
) we should still yield None
as currently done.