Skip to content

Commit

Permalink
#4858: add new output_dtype attribute to eltwise case
Browse files Browse the repository at this point in the history
  • Loading branch information
rdjogoTT committed Jun 3, 2024
1 parent 305cf5a commit e414c85
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ttnn/cpp/ttnn/operations/unary.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,12 @@ inline Tensor execute_on_worker_thread(
const Tensor& input_tensor,
const std::vector<tt::tt_metal::UnaryWithParam>& op_chain,
const std::optional<MemoryConfig>& memory_config = std::nullopt) {
DataType output_dtype = (op_chain[0].op_type == UnaryOpType::TYPECAST) ? DataType::UINT32 : input_tensor.get_dtype();
bool fp32_dest_acc_en = input_tensor.get_dtype() == DataType::UINT32 or
input_tensor.get_dtype() == DataType::INT32; // MT: Currently only uint32/int32 is moved to
// DST directly, fp32 is converted to fp16b
return operation::run(
EltwiseUnary{op_chain, memory_config.value_or(input_tensor.memory_config()), fp32_dest_acc_en},
EltwiseUnary{op_chain, memory_config.value_or(input_tensor.memory_config()), fp32_dest_acc_en, output_dtype},
{input_tensor})
.at(0);
}
Expand Down

0 comments on commit e414c85

Please sign in to comment.