/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd. All Rights Reserved
- * Copyright 2019 The TensorFlow Authors. All Rights Reserved.
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd. All Rights Reserved
+ * Copyright 2018 The TensorFlow Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* limitations under the License.
*/
-#ifndef LUCI_INTERPRETER_KERNELS_GREATER_H
-#define LUCI_INTERPRETER_KERNELS_GREATER_H
+#ifndef LUCI_INTERPRETER_KERNELS_SELECT_H
+#define LUCI_INTERPRETER_KERNELS_SELECT_H
#include "core/Kernel.h"
namespace kernels
{
-class Greater : public Kernel
+class Select : public Kernel
{
public:
- Greater(const Tensor *x, const Tensor *y, Tensor *output);
+ Select(const Tensor *cond, const Tensor *t, const Tensor *e, Tensor *output);
- const Tensor *x() const { return _inputs[0]; }
- const Tensor *y() const { return _inputs[1]; }
+ const Tensor *condition() const { return _inputs[0]; }
+ const Tensor *t() const { return _inputs[1]; }
+ const Tensor *e() const { return _inputs[2]; }
Tensor *output() const { return _outputs[0]; }
void configure() override;
private:
void evalFloat() const;
- template <typename T> void evalInteger() const;
- void evalQuantized() const;
private:
- int32_t _x_multiplier = 0;
- int _x_shift = 0;
- int32_t _y_multiplier = 0;
- int _y_shift = 0;
+ // for SelectV2
+ bool _requires_broadcast = false;
+ // True if input condition is scalar or input condition has rank one and
+ // matches the first dimension of other inputs.
+ bool _has_low_rank_input_condition = false;
};
} // namespace kernels
} // namespace luci_interpreter
-#endif // LUCI_INTERPRETER_KERNELS_GREATER_H
+#endif // LUCI_INTERPRETER_KERNELS_SELECT_H