Commit 6fd5bb93 authored by wooway777's avatar wooway777
Browse files

removed std::move

parent 1c710c19
...@@ -21,8 +21,8 @@ __C struct KVCache *createKVCache( ...@@ -21,8 +21,8 @@ __C struct KVCache *createKVCache(
auto kcache = std::vector<std::shared_ptr<Tensor>>(); auto kcache = std::vector<std::shared_ptr<Tensor>>();
auto vcache = std::vector<std::shared_ptr<Tensor>>(); auto vcache = std::vector<std::shared_ptr<Tensor>>();
for (unsigned int layer = 0; layer < nlayers; layer++) { for (unsigned int layer = 0; layer < nlayers; layer++) {
kcache.push_back(std::move(Tensor::buffer(dtype, shape_k))); kcache.push_back(Tensor::buffer(dtype, shape_k));
vcache.push_back(std::move(Tensor::buffer(dtype, shape_v))); vcache.push_back(Tensor::buffer(dtype, shape_v));
} }
cache->k.push_back(kcache); cache->k.push_back(kcache);
cache->v.push_back(vcache); cache->v.push_back(vcache);
...@@ -47,8 +47,8 @@ __C struct KVCache *duplicateKVCache(const KVCache *kv_cache, size_t seq_len) { ...@@ -47,8 +47,8 @@ __C struct KVCache *duplicateKVCache(const KVCache *kv_cache, size_t seq_len) {
auto kcache = std::vector<std::shared_ptr<Tensor>>(); auto kcache = std::vector<std::shared_ptr<Tensor>>();
auto vcache = std::vector<std::shared_ptr<Tensor>>(); auto vcache = std::vector<std::shared_ptr<Tensor>>();
for (unsigned int layer = 0; layer < nlayers; layer++) { for (unsigned int layer = 0; layer < nlayers; layer++) {
kcache.push_back(std::move(Tensor::buffer(dtype, shape_k))); kcache.push_back(Tensor::buffer(dtype, shape_k));
vcache.push_back(std::move(Tensor::buffer(dtype, shape_v))); vcache.push_back(Tensor::buffer(dtype, shape_v));
} }
new_kv_cache->k.push_back(kcache); new_kv_cache->k.push_back(kcache);
new_kv_cache->v.push_back(vcache); new_kv_cache->v.push_back(vcache);
......
...@@ -15,8 +15,8 @@ createDeepSeekV3Cache(const struct DeepSeekV3Model *model) { ...@@ -15,8 +15,8 @@ createDeepSeekV3Cache(const struct DeepSeekV3Model *model) {
auto kv_pass_cache = std::vector<std::shared_ptr<Tensor>>(); auto kv_pass_cache = std::vector<std::shared_ptr<Tensor>>();
auto k_rot_cache = std::vector<std::shared_ptr<Tensor>>(); auto k_rot_cache = std::vector<std::shared_ptr<Tensor>>();
for (size_t layer = 0; layer < nlayer; layer++) { for (size_t layer = 0; layer < nlayer; layer++) {
kv_pass_cache.push_back(std::move(Tensor::buffer(model->meta.dt_logits, kv_pass_shape))); kv_pass_cache.push_back(Tensor::buffer(model->meta.dt_logits, kv_pass_shape));
k_rot_cache.push_back(std::move(Tensor::buffer(model->meta.dt_logits, k_rot_shape))); k_rot_cache.push_back(Tensor::buffer(model->meta.dt_logits, k_rot_shape));
} }
cache->kv_pass.push_back(kv_pass_cache); cache->kv_pass.push_back(kv_pass_cache);
cache->k_rot.push_back(k_rot_cache); cache->k_rot.push_back(k_rot_cache);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment