Skip to content

Commit

Permalink
Fix header template linting (#39)
Browse files Browse the repository at this point in the history
Make the header comply with Autoware.auto linting style.

Also fix hadolint in CI.

Issue-Id: SCM-1941
Signed-off-by: Ambroise Vincent <ambroise.vincent@arm.com>
Change-Id: I9722005cca81acc1494c99e531fcc68d78bbf3db
  • Loading branch information
ambroise-arm authored May 19, 2021
1 parent 9cbde7a commit c152c4b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest

container:
image: hadolint/hadolint:latest
image: hadolint/hadolint:latest-debian

steps:

Expand Down
27 changes: 22 additions & 5 deletions scripts/tvm_cli/templates/inference_engine_tvm_config.hpp.jinja2
Original file line number Diff line number Diff line change
@@ -1,9 +1,25 @@
{%- set namespace = ["model_zoo"] + namespace.split('/') -%}
// Copyright 2021 Arm Limited and Contributors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#include "tvm_utility/pipeline{{ header_extension }}"

#pragma once
#ifndef INFERENCE_ENGINE_TVM_CONFIG_HPP_ // NOLINT
#define INFERENCE_ENGINE_TVM_CONFIG_HPP_
{% for ns in namespace %}
namespace {{ ns }} {
namespace {{ ns }}
{
{%- endfor %}

tvm_utility::pipeline::InferenceEngineTVMConfig config {
Expand All @@ -20,16 +36,17 @@ tvm_utility::pipeline::InferenceEngineTVMConfig config {

.network_inputs = {
{%- for node in input_list %}
{ "{{ node['name'] }}", { {{ node['shape']|join(', ') }} } }{{ ',' if not loop.last }}
{"{{ node['name'] }}", {{ '{' }}{{ node['shape']|join(', ') }}{{ '}}' }}{{ ',' if not loop.last }}
{%- endfor %}
},

.network_outputs = {
{%- for node in output_list %}
{ "{{ node['name'] }}", { {{ node['shape']|join(', ') }} } }{{ ',' if not loop.last }}
{"{{ node['name'] }}", {{ '{' }}{{ node['shape']|join(', ') }}{{ '}}' }}{{ ',' if not loop.last }}
{%- endfor %}
}
};
{% for ns in namespace|reverse %}
} // namespace {{ ns }}
} // namespace {{ ns }}
{%- endfor %}
#endif // INFERENCE_ENGINE_TVM_CONFIG_HPP_ // NOLINT

0 comments on commit c152c4b

Please sign in to comment.