Skip to content

Commit

Permalink
[hannk] Fix > and >= op implementations (halide#6312)
Browse files Browse the repository at this point in the history
a>b should be b<=a (not b <a)
a>=b should be b<a (not b<=a)
  • Loading branch information
steven-johnson authored Oct 12, 2021
1 parent 89b36b4 commit d4e45bd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions apps/hannk/delegate/hannk_delegate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -583,11 +583,11 @@ class HannkDelegateKernel final {
}

OpPtr BuildGreater(TfLiteContext *context, TfLiteNode *node) {
return BuildBinary(context, node, BinaryOp::Less, true);
return BuildBinary(context, node, BinaryOp::LessEqual, true);
}

OpPtr BuildGreaterEqual(TfLiteContext *context, TfLiteNode *node) {
return BuildBinary(context, node, BinaryOp::LessEqual, true);
return BuildBinary(context, node, BinaryOp::Less, true);
}

OpPtr BuildEqual(TfLiteContext *context, TfLiteNode *node) {
Expand Down
4 changes: 2 additions & 2 deletions apps/hannk/tflite/tflite_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -438,9 +438,9 @@ class Parser {
case tflite::BuiltinOperator_GATHER:
return parse_gather(op);
case tflite::BuiltinOperator_GREATER:
return parse_binary(op, BinaryOp::Less, true);
case tflite::BuiltinOperator_GREATER_EQUAL:
return parse_binary(op, BinaryOp::LessEqual, true);
case tflite::BuiltinOperator_GREATER_EQUAL:
return parse_binary(op, BinaryOp::Less, true);
case tflite::BuiltinOperator_L2_NORMALIZATION:
return parse_l2_normalization(op);
case tflite::BuiltinOperator_LESS:
Expand Down

0 comments on commit d4e45bd

Please sign in to comment.