Replace Clone() with View() (#432)

Co-authored-by: hiedean <hiedean@tju.edu.cn>
This commit is contained in:
HieDean
2023-11-20 09:20:50 +08:00
committed by GitHub
parent ac00edab5b
commit e6a2d0da3b
5 changed files with 14 additions and 12 deletions

View File

@@ -105,11 +105,11 @@ class OnlineWenetCtcModel::Impl {
// - attn_cache
// - conv_cache
// - offset
std::vector<Ort::Value> GetInitStates() const {
std::vector<Ort::Value> GetInitStates() {
std::vector<Ort::Value> ans;
ans.reserve(3);
ans.push_back(Clone(Allocator(), &attn_cache_));
ans.push_back(Clone(Allocator(), &conv_cache_));
ans.push_back(View(&attn_cache_));
ans.push_back(View(&conv_cache_));
int64_t offset_shape = 1;