#include <arm_compute/runtime/CL/functions/CLCast.h>
#include <arm_compute/runtime/CL/functions/CLArithmeticDivision.h>
#include <arm_compute/runtime/CL/functions/CLPermuteEx.h>
+#include <arm_compute/runtime/CL/functions/CLExp.h>
#include "kernel/ConcatLayer.h"
});
}
+void StageGenerator::visit(const model::operation::ExpNode &node)
+{
+ const auto output_index{node.getOutputs().at(0)};
+ const auto input_index{node.getInputs().at(model::operation::ExpNode::Input::INPUT)};
+
+ struct Param
+ {
+ model::operand::Index output_index;
+ model::operand::Index input_index;
+ };
+
+ Param param;
+
+ param.output_index = output_index;
+ param.input_index = input_index;
+
+ auto tensors = _tensor_builder;
+
+ returnStage([tensors, param](IExecutionBuilder &builder) {
+ auto output_alloc = tensors->at(param.output_index).get();
+ auto input_alloc = tensors->at(param.input_index).get();
+
+ std::unique_ptr<::arm_compute::IFunction> fn;
+
+ auto l = make_layer<::arm_compute::CLExp>();
+
+ l->configure(input_alloc->handle(), output_alloc->handle());
+
+ fn = std::move(l);
+
+ auto acl_fn = make_cl_function(std::move(fn));
+
+ builder.append(std::move(acl_fn));
+ });
+}
+
} // namespace acl_cl
} // namespace backend
} // namespace neurun
virtual void visit(const model::operation::SubNode &) override;
virtual void visit(const model::operation::CastNode &) override;
virtual void visit(const model::operation::DivNode &) override;
+ virtual void visit(const model::operation::ExpNode &) override;
private:
const neurun::model::operand::Set &_ctx;
return new operation::DivNode{inputs, outputs, param};
};
+
+ _map[ANEURALNETWORKS_EXP_EX] = [](const OperationFactory::Param &init_param) {
+ assert(init_param.input_count == 1 && init_param.output_count == 1);
+
+ operand::IndexSet outputs{init_param.outputs[0]};
+
+ // Each input should be interpreted as follows:
+ //
+ // 0 -> Input Tensor Index
+ operand::IndexSet inputs{init_param.inputs[0]};
+
+ return new operation::ExpNode{inputs, outputs};
+ };
}
neurun::model::operation::Node *OperationFactory::create(ANeuralNetworksOperationType type,
--- /dev/null
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd. 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.
+ */
+
+#include "ExpNode.h"
+
+#include <cassert>
+
+#include "NodeVisitor.h"
+
+namespace neurun
+{
+namespace model
+{
+namespace operation
+{
+
+void ExpNode::accept(NodeVisitor &&v) const { v.visit(*this); }
+
+ExpNode::ExpNode(const operand::IndexSet &inputs, const operand::IndexSet &outputs)
+ : model::operation::Node{OperandConstraint::createExact(1u), inputs, outputs}
+{
+}
+
+} // namespace operation
+} // namespace model
+} // namespace neurun
--- /dev/null
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd. 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.
+ */
+
+#ifndef __NEURUN_MODEL_OPERATION_EXP_NODE_H__
+#define __NEURUN_MODEL_OPERATION_EXP_NODE_H__
+
+#include "model/operation/Node.h"
+
+namespace neurun
+{
+namespace model
+{
+namespace operation
+{
+
+class ExpNode : public model::operation::Node
+{
+public:
+ enum Input
+ {
+ INPUT = 0
+ };
+
+public:
+ ExpNode(const operand::IndexSet &inputs, const operand::IndexSet &outputs);
+
+public:
+ virtual void accept(NodeVisitor &&) const override;
+ virtual std::string getName() const override { return "Exp"; }
+};
+
+} // namespace operation
+} // namespace model
+} // namespace neurun
+
+#endif // __NEURUN_MODEL_OPERATION_EXP_NODE_H__
#include "LogisticNode.h"
#include "CastNode.h"
#include "DivNode.h"
+#include "ExpNode.h"
OP(LogisticNode , true , LOGISTIC)
OP(DivNode , true , DIV)
OP(TransposeNode , true , TRANSPOSE)
+OP(ExpNode , true , EXP_EX)
OP(PermuteNode , false , NOT_AVAILABLE)
GeneratedTests.embedding_lookup_2d_nnfw
GeneratedTests.embedding_lookup_4d_nnfw
GeneratedTests.equal_ex*
-GeneratedTests.exp_ex*
GeneratedTests.floor_
GeneratedTests.hashtable_lookup*
GeneratedTests.l2_normalization*
conv_2d
depthwise_conv_2d
div/broadcast
+exp
fullyconnected/fc1
max_pool_2d
MODELS/mobilenet