Skip to content

Commit 421eace

Browse files
committed
fix one_hot layer
1 parent 9b7902e commit 421eace

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/caffe/layers/one_hot_layer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ void OneHotLayer<Dtype>::Forward_cpu(const vector<Blob<Dtype> *> &bottom,
8585
vector<int> b_ind = indices(i, bottom_shape);
8686
int b_idx = offset(top, axis_ind, b_ind);
8787
if (bottom_data[i] >= 0 && bottom_data[i] < depth) {
88-
int t_idx = b_idx + bottom_data[i] * top[0]->count(axis + 1);
88+
int t_idx = b_idx + int(bottom_data[i]) * top[0]->count(axis + 1);
8989
top_data[t_idx] = on_value;
9090
}
9191
}

0 commit comments

Comments
 (0)