Skip to content

Commit

Permalink
fix comparison of signed and unsigned int
Browse files Browse the repository at this point in the history
  • Loading branch information
okdshin committed Oct 9, 2018
1 parent 55aa262 commit 7a07457
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions scripts/gen_attribute_completion_and_shape_inference_hpp.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,10 @@ def main():
auto graph = make_graph(model_data.node_list); // FIXME reorder nodes
model_data.node_list = graph.node_list();
for(auto& node : model_data.node_list) {{
auto input = [&node](int i){{
auto input = [&node](auto i){{
return node.input_name_list.at(i);
}};
auto output = [&node](int i){{
auto output = [&node](auto i){{
return node.output_name_list.at(i);
}};
{code}
Expand Down Expand Up @@ -168,7 +168,7 @@ def main():
("axis", "int", None),
], '''
auto output_dims = dims_of(input(0));
for(int i = 1; i < node.input_name_list.size(); ++i) {
for(unsigned int i = 1; i < node.input_name_list.size(); ++i) {
// TODO dim check
output_dims.at(axis) += dims_of(input(i)).at(axis);
}
Expand Down Expand Up @@ -231,7 +231,7 @@ def main():
ints input_size(input_profile.dims().begin()+2,
input_profile.dims().end());
for(int i = 0; i < kernel_ndims; ++i) {
for(unsigned int i = 0; i < kernel_ndims; ++i) {
auto total_padding = strides[i] * (input_size[i] - 1)
+ output_padding[i] + kernel_shape[i] - output_shape[i];
pads[i] = total_padding - (total_padding/2);
Expand Down Expand Up @@ -308,13 +308,13 @@ def main():
], '''
auto input_dims = dims_of(input(0));
ints output_dims(input_dims.size());
for(int i = 0; i < input_dims.size(); ++i) {
for(unsigned int i = 0; i < input_dims.size(); ++i) {
output_dims.at(i) = input_dims.at(perm.at(i));
}
add_variable_to_table(output(0), dtype_of(input(0)), output_dims);
''', preprocess="""
ints perm(ndims_of(input(0)));
for(int i = 0; i < perm.size(); ++i) {{
for(unsigned int i = 0; i < perm.size(); ++i) {{
perm.at(i) = perm.size()-i-1;
}}
"""))
Expand Down

0 comments on commit 7a07457

Please sign in to comment.