Add memory format support to resize_as_ operator#27979
Closed
VitalyFedyunin wants to merge 24 commits intogh/VitalyFedyunin/14/basefrom
Closed
Add memory format support to resize_as_ operator#27979VitalyFedyunin wants to merge 24 commits intogh/VitalyFedyunin/14/basefrom
resize_as_ operator#27979VitalyFedyunin wants to merge 24 commits intogh/VitalyFedyunin/14/basefrom
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rationale to add optional memory format to
resize_as_andresize_operators is the fact that they are frequently used as inplaceempty_likeandemptyoperators inside of our code base. So having them to accept memory format similarly toempty_likeandemptyseems to be logical.We could also add two new operators, but it will be more confusing (taking into account that renaming existing operators in not an option).
Stack from ghstack:
resize_op. #28292 Add memory format support to theresize_op.operator==of TensorOptions as confusing one #28076 Killoperator==of TensorOptions as confusing oneresize_as_operator #27979 Add memory format support toresize_as_operatorAdds memory_format keyword argument (positional for cpp).
'Preserve' behavior now follows next rules:
Dense tensor is the tensor that store values in a contiguous block of memory.
Non-overlapping tensor is the tensor in which elements occupy individual non-repetitive memory.
Differential Revision: D17980311