Skip to content
This repository was archived by the owner on Jan 3, 2023. It is now read-only.

Commit 0bbd6f9

Browse files
[ONNX] Use v1 ops in Convolution operator. (#4123)
* Return v1::Reshape in builder::reshape function. * Use default_opset in ONNX Convolution operators. * Revert builder::reshape to return v0 op. * Remove unused code. * Update year in license header. * Remove AutoBroadcastSpec arg and use default value. Co-authored-by: Scott Cyphers <[email protected]>
1 parent 663e9bb commit 0bbd6f9

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/ngraph/frontend/onnx_import/op/conv.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,12 @@ namespace ngraph
131131
auto bias = inputs.at(2);
132132
const Shape& new_shape = conv_node->get_shape();
133133

134-
auto broadcasted_bias = std::make_shared<ngraph::opset0::Broadcast>(
134+
auto broadcasted_bias = std::make_shared<default_opset::Broadcast>(
135135
bias,
136-
new_shape,
137-
ngraph::op::calculate_broadcast_axes(new_shape, bias->get_shape(), 1));
138-
return {std::make_shared<ngraph::opset0::Add>(conv_node, broadcasted_bias)};
136+
default_opset::Constant::create(
137+
element::i64, Shape{new_shape.size()}, new_shape),
138+
default_opset::Constant::create(element::i64, Shape{1}, {1}));
139+
return {std::make_shared<default_opset::Add>(conv_node, broadcasted_bias)};
139140
}
140141

141142
} // namespace set_1

test/opset_pass/reduction_opset_pass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//*****************************************************************************
2-
// Copyright 2017-2019 Intel Corporation
2+
// Copyright 2017-2020 Intel Corporation
33
//
44
// Licensed under the Apache License, Version 2.0 (the "License");
55
// you may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)