Skip to content

Commit

Permalink
chore: reverse timesteps and embeddings to support descending order o…
Browse files Browse the repository at this point in the history
…f the timesteps and embeddings
  • Loading branch information
RSMNYS committed Dec 29, 2024
1 parent 0835157 commit b035768
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mobile_back_tflite/cpp/backend_tflite/embedding_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ bool TsEmbeddingParser::parse_pickle(const std::string& filename) {
EMBEDDING_DIM * sizeof(float));
}

// Reverse both timesteps and embeddings before storing
std::reverse(timesteps.begin(), timesteps.end());
std::reverse(embeddings.begin(), embeddings.end());

// Store in maps
timesteps_[num_timesteps] = std::move(timesteps);
embeddings_[num_timesteps] = std::move(embeddings);
Expand Down

0 comments on commit b035768

Please sign in to comment.