Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions backends/cadence/hifi/operators/op_quantized_relu_out.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ void quantized_relu_per_tensor_out(
const int64_t out_multiplier,
const int64_t out_shift,
Tensor& output) {
const uint8_t _in_zero_point = static_cast<uint8_t>(in_zero_point);
const uint8_t _out_zero_point = static_cast<uint8_t>(out_zero_point);
const int32_t _out_multiplier = static_cast<int32_t>(out_multiplier);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do these two need to move?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

they don't you're right

const int32_t _out_shift = static_cast<int32_t>(out_shift);
if (input.scalar_type() == executorch::aten::ScalarType::Byte) {
const uint8_t _in_zero_point = static_cast<uint8_t>(in_zero_point);
const uint8_t _out_zero_point = static_cast<uint8_t>(out_zero_point);
const int32_t _out_multiplier = static_cast<int32_t>(out_multiplier);
const int32_t _out_shift = static_cast<int32_t>(out_shift);
const uint8_t* p_in = input.const_data_ptr<uint8_t>();
uint8_t* p_out = output.mutable_data_ptr<uint8_t>();

Expand All @@ -48,6 +48,10 @@ void quantized_relu_per_tensor_out(
ET_CHECK_MSG(ret_val == 0, "An internal error occured");

} else if (input.scalar_type() == executorch::aten::ScalarType::Char) {
const int8_t _in_zero_point = static_cast<int8_t>(in_zero_point);
const int8_t _out_zero_point = static_cast<int8_t>(out_zero_point);
const int32_t _out_multiplier = static_cast<int32_t>(out_multiplier);
const int32_t _out_shift = static_cast<int32_t>(out_shift);
const int8_t* p_in = input.const_data_ptr<int8_t>();
int8_t* p_out = output.mutable_data_ptr<int8_t>();

Expand Down
Loading