Skip to content

Commit

Permalink
examples: rnn: use dim_t to avoid possible loss of data
Browse files Browse the repository at this point in the history
  • Loading branch information
Alok Bakshi authored and alokbakshi committed May 27, 2021
1 parent 0e3555b commit 9c00abf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/cpu_rnn_inference_int8.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ void compute_attention(float *context_vectors, dim_t src_seq_length_max,
// we calculate max_idx t so that A_i <= A_t and calculate the expression as
// exp(A_i - A_t) / \sum_i exp(A_i - A_t)
// which mitigates the overflow errors
std::vector<int> max_idx(batch, 0);
std::vector<dim_t> max_idx(batch, 0);
PRAGMA_OMP_PARALLEL_FOR_COLLAPSE(1)
for (dim_t j = 0; j < batch; j++) {
for (dim_t i = 1; i < src_seq_length_max; i++) {
Expand Down

0 comments on commit 9c00abf

Please sign in to comment.