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

[FrontEnd]enable PDPD 16 ops conversion Part2 #6632

Merged
merged 13 commits into from
Jul 30, 2021
2 changes: 1 addition & 1 deletion ngraph/frontend/paddlepaddle/src/op/argmax.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// SPDX-License-Identifier: Apache-2.0
//

#include "argmax.hpp"
ilyachur marked this conversation as resolved.
Show resolved Hide resolved
#include <ngraph/opsets/opset6.hpp>
#include <node_context.hpp>

namespace ngraph
{
Expand Down
20 changes: 0 additions & 20 deletions ngraph/frontend/paddlepaddle/src/op/argmax.hpp

This file was deleted.

2 changes: 1 addition & 1 deletion ngraph/frontend/paddlepaddle/src/op/assign_value.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// SPDX-License-Identifier: Apache-2.0
//

#include "assign_value.hpp"
#include <ngraph/opsets/opset6.hpp>
#include <node_context.hpp>
namespace ngraph
{
namespace frontend
Expand Down
21 changes: 0 additions & 21 deletions ngraph/frontend/paddlepaddle/src/op/assign_value.hpp

This file was deleted.

2 changes: 1 addition & 1 deletion ngraph/frontend/paddlepaddle/src/op/batch_norm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// SPDX-License-Identifier: Apache-2.0
//

#include "batch_norm.hpp"
#include <ngraph/opsets/opset6.hpp>
#include <node_context.hpp>

namespace ngraph
{
Expand Down
20 changes: 0 additions & 20 deletions ngraph/frontend/paddlepaddle/src/op/batch_norm.hpp

This file was deleted.

2 changes: 1 addition & 1 deletion ngraph/frontend/paddlepaddle/src/op/cast.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// SPDX-License-Identifier: Apache-2.0
//

#include "cast.hpp"
#include <ngraph/opsets/opset6.hpp>
#include <node_context.hpp>

namespace ngraph
{
Expand Down
20 changes: 0 additions & 20 deletions ngraph/frontend/paddlepaddle/src/op/cast.hpp

This file was deleted.

2 changes: 1 addition & 1 deletion ngraph/frontend/paddlepaddle/src/op/clip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// SPDX-License-Identifier: Apache-2.0
//

#include "clip.hpp"
#include <ngraph/opsets/opset6.hpp>
#include <node_context.hpp>

namespace ngraph
{
Expand Down
20 changes: 0 additions & 20 deletions ngraph/frontend/paddlepaddle/src/op/clip.hpp

This file was deleted.

2 changes: 1 addition & 1 deletion ngraph/frontend/paddlepaddle/src/op/concat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// SPDX-License-Identifier: Apache-2.0
//

#include "concat.hpp"
#include <ngraph/opsets/opset6.hpp>
#include <node_context.hpp>

namespace ngraph
{
Expand Down
20 changes: 0 additions & 20 deletions ngraph/frontend/paddlepaddle/src/op/concat.hpp

This file was deleted.

1 change: 0 additions & 1 deletion ngraph/frontend/paddlepaddle/src/op/conv2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// SPDX-License-Identifier: Apache-2.0
//

#include "conv2d.hpp"
#include <ngraph/opsets/opset6.hpp>
#include "conv2d_utils.hpp"

Expand Down
21 changes: 0 additions & 21 deletions ngraph/frontend/paddlepaddle/src/op/conv2d.hpp

This file was deleted.

26 changes: 26 additions & 0 deletions ngraph/frontend/paddlepaddle/src/op/conv2d_transpose.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Copyright (C) 2018-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//

#include <ngraph/opsets/opset6.hpp>
#include <node_context.hpp>
#include "conv2d_utils.hpp"

namespace ngraph
{
namespace frontend
{
namespace pdpd
{
namespace op
{
NamedOutputs conv2d_transpose(const NodeContext& node)
{
return conv2d_base<opset6::GroupConvolutionBackpropData,
opset6::ConvolutionBackpropData>(node);
}

} // namespace op
} // namespace pdpd
} // namespace frontend
} // namespace ngraph
45 changes: 45 additions & 0 deletions ngraph/frontend/paddlepaddle/src/op/dropout.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// Copyright (C) 2018-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//

#include <ngraph/opsets/opset6.hpp>
#include <node_context.hpp>

namespace ngraph
{
namespace frontend
{
namespace pdpd
{
namespace op
{
NamedOutputs dropout(const NodeContext& node)
{
auto data = node.get_ng_input("X");
auto dropout_implementation =
node.get_attribute<std::string>("dropout_implementation");
PDPD_OP_VALIDATION_CHECK(node,
(dropout_implementation == "downgrade_in_infer" ||
dropout_implementation == "upscale_in_train"),
"Unsupported dropout mode!");
if (dropout_implementation == "downgrade_in_infer")
mangguo321 marked this conversation as resolved.
Show resolved Hide resolved
{
auto dropout_prob = ngraph::opset6::Constant::create(
ngraph::element::f32,
{1},
{1 - node.get_attribute<float>("dropout_prob")});
return node.default_single_output_mapping(
{std::make_shared<ngraph::opset6::Multiply>(data, dropout_prob)},
{"Out"});
}
else
{
return node.default_single_output_mapping(data.get_node_shared_ptr(),
{"Out"});
}
}

} // namespace op
} // namespace pdpd
} // namespace frontend
} // namespace ngraph
12 changes: 11 additions & 1 deletion ngraph/frontend/paddlepaddle/src/op/elementwise_ops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <map>

#include <ngraph/opsets/opset6.hpp>
#include "elementwise_ops.hpp"
#include <node_context.hpp>

namespace ngraph
{
Expand Down Expand Up @@ -96,6 +96,16 @@ namespace ngraph
return elementwise_ops<ngraph::opset6::Power>(node_context);
}

NamedOutputs elementwise_equal(const NodeContext& node_context)
{
return elementwise_ops<ngraph::opset6::Equal>(node_context);
}

NamedOutputs elementwise_greater_equal(const NodeContext& node_context)
{
return elementwise_ops<ngraph::opset6::GreaterEqual>(node_context);
}

} // namespace op
} // namespace pdpd
} // namespace frontend
Expand Down
26 changes: 0 additions & 26 deletions ngraph/frontend/paddlepaddle/src/op/elementwise_ops.hpp

This file was deleted.

Loading