Skip to content

Commit 06cb42a

Browse files
committed
Fix
1 parent 9b2610e commit 06cb42a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

extension/llm/runner/util.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ inline runtime::Result<TensorPtr> populate_start_pos_or_cache_position(
111111
const char* method_name,
112112
Module* module,
113113
int64_t& start_pos,
114-
std::vector<int64_t>& cache_positions_underlying_vector,
114+
std::vector<int64_t>& cache_positions_vec,
115115
int seq_len) {
116116
// Get expected shape of cache position tensor, which should be the second
117117
// argument
@@ -129,12 +129,12 @@ inline runtime::Result<TensorPtr> populate_start_pos_or_cache_position(
129129
// `cache_position` goes from start_pos to start_pos +
130130
// encoder_output.size(1). e.g. if start_pos = 2 and encoder_output.size(1)
131131
// = 5, cache_position_tensor should be [2, 3, 4, 5, 6].
132-
cache_positions_underlying_vector.resize(seq_len);
132+
cache_positions_vec.resize(seq_len);
133133
for (int64_t i = 0; i < seq_len; ++i) {
134-
cache_positions[i] = start_pos + i;
134+
cache_positions_vec[i] = start_pos + i;
135135
}
136136
return ::executorch::extension::from_blob(
137-
cache_positions.data(),
137+
cache_positions_vec.data(),
138138
{static_cast<int>(seq_len)},
139139
executorch::aten::ScalarType::Long);
140140
} else {

0 commit comments

Comments
 (0)