Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve review comments #3

Merged
merged 3 commits into from
Oct 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions model-optimizer/extensions/middle/FusedBatchNormTraining.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ def replace_pattern(self, graph: Graph, match: dict):

input_rank = len(node.in_port(0).data.get_shape())
rng = create_op_with_const_inputs(graph, Range,
{0: int64_array(2), 1: int64_array(input_rank), 2: int64_array(1)},
{0: int64_array(1), 1: int64_array(input_rank - 1), 2: int64_array(1)},
{'name': node_name + '/Range', 'output_type': np.int64})
mvn = MVN(graph, {'name': node_name + '/mvn_', 'eps': node.soft_get('eps', 1e-6), 'eps_mode': 'outside_sqrt',
mvn = MVN(graph, {'name': node_name + '/mvn_', 'eps': node.soft_get('eps', 1e-6), 'eps_mode': 'inside_sqrt',
'normalize_variance': 1, 'override_output_shape': True}).create_node()
node.in_port(0).get_connection().insert_node(mvn)
mvn.in_port(1).connect(rng.out_port(0))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,16 @@
'reshape_to_orig': {'type': 'Reshape', 'value': None, 'kind': 'op', 'op': 'Reshape'},
'reshape_to_orig_data': {'value': None, 'shape': None, 'kind': 'data'},

'start': {'kind': 'op', 'op': 'Const'},
'start_data': {'value': None, 'shape': None, 'kind': 'data'},
'stop': {'kind': 'op', 'op': 'Const'},
'stop_data': {'value': None, 'shape': None, 'kind': 'data'},
'step': {'kind': 'op', 'op': 'Const'},
'step_data': {'value': None, 'shape': None, 'kind': 'data'},
'start': {'kind': 'op', 'op': 'Const', 'value': int64_array(1)},
'start_data': {'value': None, 'shape': None, 'kind': 'data', 'value': int64_array(1)},
'stop': {'kind': 'op', 'op': 'Const', 'value': int64_array(3)},
'stop_data': {'value': None, 'shape': None, 'kind': 'data', 'value': int64_array(3)},
'step': {'kind': 'op', 'op': 'Const', 'value': int64_array(1)},
'step_data': {'value': None, 'shape': None, 'kind': 'data', 'value': int64_array(1)},
'mvn_axes': {'kind': 'op', 'op': 'Range'},
'mvn_axes_data': {'value': None, 'shape': None, 'kind': 'data'},

'mvn': {'type': 'MVN', 'value': None, 'kind': 'op', 'op': 'MVN', 'eps': 1e-3},
'mvn': {'type': 'MVN', 'value': None, 'kind': 'op', 'op': 'MVN', 'eps': 1e-3, 'eps_mode': 'inside_sqrt'},
'mvn_data': {'value': None, 'shape': None, 'kind': 'data'},

'reshape_1': {'type': 'Reshape', 'value': None, 'kind': 'op', 'op': 'Reshape'},
Expand Down
19 changes: 16 additions & 3 deletions ngraph/frontend/tensorflow/src/utils.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
// Copyright (C) 2018-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
/* Copyright (C) 2018-2021 Intel Corporation
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2017 The TensorFlow Authors. All Rights Reserved.
* 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.
*
* Modification Copyright (C) 2021 Intel Corporation
==============================================================================*/

#pragma once

Expand Down