1 // Copyright (C) 2018-2019 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
5 #include <builders/ie_softmax_layer.hpp>
6 #include <ie_cnn_layer_builder.h>
10 using namespace InferenceEngine;
12 Builder::SoftMaxLayer::SoftMaxLayer(const std::string& name): LayerDecorator("SoftMax", name) {
13 getLayer()->getOutputPorts().resize(1);
14 getLayer()->getInputPorts().resize(1);
18 Builder::SoftMaxLayer::SoftMaxLayer(const Layer::Ptr& layer): LayerDecorator(layer) {
22 Builder::SoftMaxLayer::SoftMaxLayer(const Layer::CPtr& layer): LayerDecorator(layer) {
26 Builder::SoftMaxLayer& Builder::SoftMaxLayer::setName(const std::string& name) {
27 getLayer()->setName(name);
31 const Port& Builder::SoftMaxLayer::getPort() const {
32 return getLayer()->getOutputPorts()[0];
35 Builder::SoftMaxLayer& Builder::SoftMaxLayer::setPort(const Port &port) {
36 getLayer()->getOutputPorts()[0] = port;
37 getLayer()->getInputPorts()[0] = port;
41 size_t Builder::SoftMaxLayer::getAxis() const {
42 return getLayer()->getParameters().at("axis");
45 Builder::SoftMaxLayer& Builder::SoftMaxLayer::setAxis(size_t axis) {
46 getLayer()->getParameters()["axis"] = axis;
50 REG_CONVERTER_FOR(SoftMax, [](const CNNLayerPtr& cnnLayer, Builder::Layer& layer) {
51 layer.getParameters()["axis"] = static_cast<size_t>(cnnLayer->GetParamAsUInt("axis", 1));