Commit 5c153f46 authored by Amy Zhuang's avatar Amy Zhuang Committed by Scott Cyphers

Fix a bug in Gather Eigen kernel. (#3744)

parent f054faaf
......@@ -85,7 +85,6 @@ namespace ngraph
static_cast<ElementType*>(inputs), in_dims);
auto indices_ptr = static_cast<IndicesType*>(indices);
IndicesType index_value;
auto indices_rank = indices_shape.size();
auto outer_loop_num = 1;
for (size_t i = 0; i < axis; i++)
......@@ -125,7 +124,7 @@ namespace ngraph
// at axis
in_extents[axis] = 1;
// at axis, get the value from indices arg
index_value = indices_ptr[0];
IndicesType index_value = indices_ptr[0];
// take care of negative indices
in_offsets[axis] =
index_value >= 0 ? index_value : index_value + axis_length;
......@@ -200,7 +199,7 @@ namespace ngraph
}
// at axis, get the value from indices arg
int k = i % num_indices;
index_value = indices_ptr[k];
IndicesType index_value = indices_ptr[k];
// take care of negative indices
in_offsets[axis] =
index_value >= 0 ? index_value : index_value + axis_length;
......
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