[CustomOP Inplace] Automap inplace dtype and shape, support vector<Tensor> output #52114
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.
PR types
New features
PR changes
OPs
Describe
Pcard-66988
用户设置
SetInplaceMap
后,如果Outputs
中的名称都在 InplaceMap 中,则不再需要显式的指定SetInferShapeFn
和SetInferDtypeFn
,自动对 InplaceMap 中输入输出间的 shape dtype 做映射,提升用户易用性。本 PR 支持了 inplace vector 输入,同时支持使用 inplace 方式输出 vector,因为
SetInferShapeFn
和SetInferDtypeFn
中不支持输出 vector 对应的 shape 和 dtype,只能通过自动映射的方式隐式处理。After setting
SetInplaceMap
, if all the names ofOutputs
are inside InplaceMap, users don't have to setSetInferShapeFn
andSetInferDtypeFn
explicitly, the framework will map the shape and data type between inputs and outputs automatically.This PR also supports inplace vector<Tensor> input. Users have to make the use of inplace mechanism to output vector<Tensor>. we have to implicitly map inputs and outputs' shape and data type because
SetInferShapeFn
andSetInferDtypeFn
cannot support output shape and data type of vector<Tensor>