diff --git a/scripts/gen_attribute_completion_and_shape_inference_hpp.py b/scripts/gen_attribute_completion_and_shape_inference_hpp.py index 4df84fd..8bbeed7 100644 --- a/scripts/gen_attribute_completion_and_shape_inference_hpp.py +++ b/scripts/gen_attribute_completion_and_shape_inference_hpp.py @@ -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} @@ -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); } @@ -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); @@ -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; }} """))