Skip to content

[shapex] Handle case where shape.shape_of feeds into from_extent_tensor - #2667

Closed
jpienaar wants to merge 1 commit into
iree-org:mainfrom
jpienaar:getextent
Closed

jpienaar wants to merge 1 commit into
iree-org:mainfrom
jpienaar:getextent

Conversation

@jpienaar

Copy link
Copy Markdown
Member

Pre-fetching for upstream change where shape.shape_of can produce a
ranked tensor of index, rather than just a shape and post
canonicalization one has a shape.shape_of feeding into a
shapex.from_extent_tensor directly. The lowering of shape_of ti
get_ranked_shape then leads to an invalid ranked_tensor as input to
from_extent_tensor, e.g.,

%63 = "shapex.get_ranked_shape"(%55) : (tensor<?x10xf32>) -> !shapex.ranked_shape<[?,10]>
%64 = "shapex.from_extent_tensor"(%63) : (!shapex.ranked_shape<[?,10]>) -> !shapex.ranked_shape<[?,?]>

Avoid this by removing the from_extent_tensor in these cases and
propagating the value from get_ranked_shape directly.

…nt_tensor

Pre-fetching for upstream change where shape.shape_of can produce a
ranked tensor of index, rather than just a shape and post
canonicalization one has a shape.shape_of feeding into a
shapex.from_extent_tensor directly. The lowering of shape_of ti
get_ranked_shape then leads to an invalid ranked_tensor as input to
from_extent_tensor, e.g.,

    %63 = "shapex.get_ranked_shape"(%55) : (tensor<?x10xf32>) -> !shapex.ranked_shape<[?,10]>
    %64 = "shapex.from_extent_tensor"(%63) : (!shapex.ranked_shape<[?,10]>) -> !shapex.ranked_shape<[?,?]>

Avoid this by removing the from_extent_tensor in these cases and
propagating the value from get_ranked_shape directly.
@google-cla google-cla Bot added the cla: yes label Jul 25, 2020
copybara-service Bot pushed a commit that referenced this pull request Jul 25, 2020
Pre-fetching for upstream change where shape.shape_of can produce a
ranked tensor of index, rather than just a shape and post
canonicalization one has a shape.shape_of feeding into a
shapex.from_extent_tensor directly. The lowering of shape_of ti
get_ranked_shape then leads to an invalid ranked_tensor as input to
from_extent_tensor, e.g.,

%63 = "shapex.get_ranked_shape"(%55) : (tensor<?x10xf32>) -> !shapex.ranked_shape<[?,10]>
%64 = "shapex.from_extent_tensor"(%63) : (!shapex.ranked_shape<[?,10]>) -> !shapex.ranked_shape<[?,?]>

Avoid this by removing the from_extent_tensor in these cases and
propagating the value from get_ranked_shape directly.

Author: Jacques Pienaar <[email protected]>
Closes: #2667
PiperOrigin-RevId: 323191580
@stellaraccident

Copy link
Copy Markdown
Collaborator

Note: I have submitted this on the internal side to unblock the integrate there. We will hold this one open until successful.

copybara-service Bot pushed a commit that referenced this pull request Jul 26, 2020
Pre-fetching for upstream change where shape.shape_of can produce a
ranked tensor of index, rather than just a shape and post
canonicalization one has a shape.shape_of feeding into a
shapex.from_extent_tensor directly. The lowering of shape_of ti
get_ranked_shape then leads to an invalid ranked_tensor as input to
from_extent_tensor, e.g.,

%63 = "shapex.get_ranked_shape"(%55) : (tensor<?x10xf32>) -> !shapex.ranked_shape<[?,10]>
%64 = "shapex.from_extent_tensor"(%63) : (!shapex.ranked_shape<[?,10]>) -> !shapex.ranked_shape<[?,?]>

Avoid this by removing the from_extent_tensor in these cases and
propagating the value from get_ranked_shape directly.

Author: Jacques Pienaar <[email protected]>
Closes: #2667
PiperOrigin-RevId: 323191580
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants