Inference add type check in copy_from_cpu #36429
Merged
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
Others
PR changes
Others
Describe
1、copy_from_cpu只支持Numpy ndarray的输入,增加类型检查
pybind的
copy_from_cpu
接口,改名为copy_from_cpu_bind
,inference/__init__.py
中重写copy_from_cpu
加上类型检查调用copy_from_cpu_bind
将检查加入到python测的原因是:如果在C++测进行转换,会有
py::object
到py::array
转换的开销2、解决trt6中批量set动态shape时,无效参数会报出大量warning的问题
3、增加
GetTrtCompileVersion
和GetTrtRuntimeVersion
接口,用于获取trt版本信息