File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed
examples/control-vector-generator Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -290,17 +290,13 @@ static void power_iteration(
290
290
if (calc_square) {
291
291
// copy and store the square matrix if needed
292
292
GGML_ASSERT (result.calculated_square != NULL );
293
- std::vector<uint8_t > tmp_buf (ggml_nbytes (model.dev_square ));
294
- ggml_backend_tensor_get (result.calculated_square , tmp_buf.data (), 0 , tmp_buf.size ());
295
- ggml_backend_tensor_set (model.dev_square , tmp_buf.data (), 0 , tmp_buf.size ());
293
+ ggml_backend_tensor_copy (result.calculated_square , model.dev_square );
296
294
}
297
295
298
296
{
299
297
// copy last eigen vector and store as input for next iteration
300
298
GGML_ASSERT (last_eigenvector != NULL );
301
- std::vector<uint8_t > tmp_buf (ggml_nbytes (last_eigenvector));
302
- ggml_backend_tensor_get (last_eigenvector, tmp_buf.data (), 0 , tmp_buf.size ());
303
- ggml_backend_tensor_set (model.dev_eigenvector , tmp_buf.data (), 0 , tmp_buf.size ());
299
+ ggml_backend_tensor_copy (last_eigenvector, model.dev_eigenvector );
304
300
}
305
301
306
302
printf (" %s: layer %d/%d, iteration: %d / total: %d (batch = %d) ...\n " ,
You can’t perform that action at this time.
0 commit comments