Skip to content

Commit

Permalink
[onert] Remove unnecessary op conversion (#14168)
Browse files Browse the repository at this point in the history
This commit removes unnecessary Loss op conversion from TrainableOperationConverter.

ONE-DCO-1.0-Signed-off-by: ragmani <[email protected]>
  • Loading branch information
ragmani authored Oct 8, 2024
1 parent f2bdd85 commit 091b9d5
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,6 @@ void TrainableOperationConverter::visit(const ir::operation::FullyConnected &nod
_return_op = std::make_unique<ir::train::operation::FullyConnected>(node);
}

void TrainableOperationConverter::visit(const ir::operation::Loss &node)
{
const auto &y_pred_index = node.getInputs().at(ir::operation::Loss::Input::Y_PRED);
const auto &y_pred = _tgraph.operands().at(y_pred_index);
const auto &y_pred_node = _tgraph.operations().at(y_pred.getDef());
const auto y_pred_op_code = y_pred_node.opcode();

_return_op =
std::make_unique<ir::train::operation::Loss>(node, _training_info->lossInfo(), y_pred_op_code);
}

void TrainableOperationConverter::visit(const ir::operation::Pad &node)
{
_return_op = std::make_unique<ir::train::operation::Pad>(node);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class TrainableOperationConverter : public UntrainableOperationConverter
void visit(const ir::operation::DepthwiseConv2D &) override;
void visit(const ir::operation::ElementwiseActivation &) override;
void visit(const ir::operation::FullyConnected &) override;
void visit(const ir::operation::Loss &node) override;
// ir::operation::Loss is inserted and converted only by LossInsertionPass
void visit(const ir::operation::Pad &node) override;
void visit(const ir::operation::Permute &node) override;
void visit(const ir::operation::Pool2D &node) override;
Expand Down

0 comments on commit 091b9d5

Please sign in to comment.