Skip to content

Commit

Permalink
[luci/service] Migrate logistic op to sinf::Algorithm (Samsung#14006)
Browse files Browse the repository at this point in the history
This commit migrates logistic operation to sinf::Algorithm

ONE-DCO-1.0-Signed-off-by: Jongwon Yang <[email protected]>
  • Loading branch information
jongwonyang authored Sep 13, 2024
1 parent c8a53cf commit 2a53b2b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class Algorithm final : public luci::CircleNodeVisitor<loco::TensorShape>
// loco::TensorShape visit(const luci::CircleLogicalAnd *node) final;
// loco::TensorShape visit(const luci::CircleLogicalNot *node) final;
// loco::TensorShape visit(const luci::CircleLogicalOr *node) final;
// loco::TensorShape visit(const luci::CircleLogistic *node) final;
loco::TensorShape visit(const luci::CircleLogistic *node) final;
// loco::TensorShape visit(const luci::CircleLogSoftmax *node) final;
// loco::TensorShape visit(const luci::CircleMatrixDiag *node) final;
// loco::TensorShape visit(const luci::CircleMatrixSetDiag *node) final;
Expand Down
2 changes: 0 additions & 2 deletions compiler/luci/service/src/CircleShapeInferenceRule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1928,8 +1928,6 @@ class ShapeInferenceAlgorithm final : public luci::CircleNodeVisitor<loco::NodeS

loco::NodeShape visit(const luci::CircleLogicalOr *node) final { return use_x(node); }

loco::NodeShape visit(const luci::CircleLogistic *node) final { return use_x(node); }

loco::NodeShape visit(const luci::CircleLogSoftmax *node) final { return use_logits(node); }

loco::NodeShape visit(const luci::CircleMatrixDiag *node) final
Expand Down
15 changes: 15 additions & 0 deletions compiler/luci/service/src/Nodes/CircleLogistic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
* limitations under the License.
*/

#include "luci/Service/CircleShapeInference.h"

#include "CircleCloneNode.h"
#include "CircleShapeInferenceHelper.h"

namespace luci
{
Expand All @@ -24,4 +27,16 @@ luci::CircleNode *CloneNodeLet<CN::KLMN>::visit(const luci::CircleLogistic *)
return _graph->nodes()->create<luci::CircleLogistic>();
}

namespace sinf
{

loco::TensorShape Algorithm::visit(const luci::CircleLogistic *node)
{
const auto input_x = loco::must_cast<luci::CircleNode *>(node->x());
const auto input_shape = circle_shape(input_x);
return input_shape;
}

} // namespace sinf

} // namespace luci

0 comments on commit 2a53b2b

Please sign in to comment.