Skip to content

Commit c9858db

Browse files
authored
[onert] Remove Einsum support (#15178)
This commit removes einsum support in onert and tests. ONE-DCO-1.0-Signed-off-by: Hyeongseok Oh <hseok82.oh@samsung.com>
1 parent cc9df75 commit c9858db

24 files changed

+4
-1541
lines changed

runtime/compute/cker/include/cker/operation/Einsum.h

Lines changed: 0 additions & 936 deletions
This file was deleted.

runtime/compute/cker/include/cker/operation/FusedBatchNorm.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
#include "cker/Utils.h"
2424

2525
#include "cker/operation/Helper/Tensor.h"
26-
#include "cker/operation/Helper/MatmulBCast.h"
2726

2827
#include "Transpose.h"
2928
#include "BatchMatMul.h"
@@ -146,7 +145,7 @@ class FusedBatchNorm
146145
if (output->copyFrom(input, shape))
147146
return;
148147

149-
throw std::runtime_error{"Einsum: Encountered error while reshaping a Tensor"};
148+
throw std::runtime_error{"FusedBatchNorm: Encountered error while reshaping a Tensor"};
150149
}
151150

152151
private:

runtime/compute/cker/include/cker/operation/Helper/BCast.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,6 @@
1818
#ifndef __NNFW_CKER_HELPER_BCAST_H__
1919
#define __NNFW_CKER_HELPER_BCAST_H__
2020

21-
/**
22-
* ToDo : This file will be moved into upper folder when integrate with other
23-
* custom operations.
24-
* And It should merged with EinsumHelper's BCast.
25-
**/
26-
2721
#include "cker/Shape.h"
2822
#include "cker/eigen/EigenSupport.h"
2923

runtime/compute/cker/include/cker/operation/Helper/MatmulBCast.h

Lines changed: 0 additions & 95 deletions
This file was deleted.

runtime/onert/backend/cpu/KernelGenerator.cc

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
#include "ops/ConvolutionLayer.h"
2626
#include "ops/DepthToSpaceLayer.h"
2727
#include "ops/DepthwiseConvolutionLayer.h"
28-
#include "ops/EinsumLayer.h"
2928
#include "ops/ElementwiseActivationLayer.h"
3029
#include "ops/ElementwiseBinaryLayer.h"
3130
#include "ops/ElementwiseUnaryLayer.h"
@@ -602,24 +601,6 @@ void KernelGenerator::visit(const ir::operation::OneHot &node)
602601
_return_fn = std::move(fn);
603602
}
604603

605-
void KernelGenerator::visit(const ir::operation::Einsum &node)
606-
{
607-
const auto ofm_index{node.getOutputs().at(0)};
608-
609-
auto output_tensor = _tensor_reg->getPortableTensor(ofm_index);
610-
std::vector<const IPortableTensor *> input_tensors;
611-
for (const auto &ifm_idx : node.getInputs())
612-
input_tensors.emplace_back(_tensor_reg->getPortableTensor(ifm_idx));
613-
614-
const auto &equation = node.param().equation;
615-
616-
auto fn = std::make_unique<ops::EinsumLayer>();
617-
618-
fn->configure(input_tensors, equation, output_tensor);
619-
620-
_return_fn = std::move(fn);
621-
}
622-
623604
void KernelGenerator::visit(const ir::operation::Custom &node)
624605
{
625606
auto fill_op_info = [&](const ir::OperandIndexSequence &opSeq,

runtime/onert/backend/cpu/KernelGenerator.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ class KernelGenerator : public basic::KernelGeneratorBase
5252
void visit(const ir::operation::Custom &node) override;
5353
void visit(const ir::operation::DepthToSpace &) override;
5454
void visit(const ir::operation::DepthwiseConv2D &) override;
55-
void visit(const ir::operation::Einsum &) override;
5655
void visit(const ir::operation::ElementwiseActivation &) override;
5756
void visit(const ir::operation::ElementwiseBinary &) override;
5857
void visit(const ir::operation::ElementwiseUnary &) override;

runtime/onert/backend/cpu/ops/EinsumLayer.cc

Lines changed: 0 additions & 74 deletions
This file was deleted.

runtime/onert/backend/cpu/ops/EinsumLayer.h

Lines changed: 0 additions & 60 deletions
This file was deleted.

runtime/onert/core/include/ir/Operations.Include.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
#include "ir/operation/Custom.h"
3434
#include "ir/operation/DepthToSpace.h"
3535
#include "ir/operation/DepthwiseConv2D.h"
36-
#include "ir/operation/Einsum.h"
3736
#include "ir/operation/ElementwiseActivation.h"
3837
#include "ir/operation/ElementwiseBinary.h"
3938
#include "ir/operation/ElementwiseUnary.h"

runtime/onert/core/include/ir/Operations.lst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ OP(ConvertFp32ToFp16)
3636
OP(Custom)
3737
OP(DepthToSpace)
3838
OP(DepthwiseConv2D)
39-
OP(Einsum)
4039
OP(ElementwiseActivation)
4140
OP(ElementwiseBinary)
4241
OP(ElementwiseUnary)

0 commit comments

Comments
 (0)