forked from openvinotoolkit/openvino
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1e9bd8a
commit 31dc258
Showing
2 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Copyright (C) 2020 Intel Corporation | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
#include "plaidml_ops.hpp" | ||
|
||
#include "ngraph/opsets/opset.hpp" | ||
#include "ngraph/opsets/opset4.hpp" | ||
|
||
#include "plaidml/op/op.h" | ||
|
||
using namespace plaidml; // NOLINT[build/namespaces] | ||
using namespace InferenceEngine; // NOLINT[build/namespaces] | ||
|
||
namespace PlaidMLPlugin { | ||
|
||
static OpRegistration reg("swish", [](const Context& ctx) { | ||
IE_ASSERT(ctx.operands.size() == 2); | ||
auto I = ctx.operands.at(0); | ||
auto beta = ctx.operands.at(1); | ||
|
||
return edsl::make_tuple(I / (1.0 + edsl::exp(-(beta * I)))); | ||
}); | ||
|
||
} // namespace PlaidMLPlugin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters