ttnn.where
(and eltwise ops in general) mixed data types issue
#17998
Labels
bug
Something isn't working
ttnn.where
(and eltwise ops in general) mixed data types issue
#17998
As title says issue is related to behaviour of (binary) eltwise ops in the presence of mixed data type operands. Correct me if I'm wrong but currently the result's data type will default to the data type of the first operand, which leads to some weird cases like:
Most frameworks would default to f32 in both cases. Is there an initiative to make eltwise ops work like this in TTNN?
Related to that is the behaviour of
ttnn.where
. The data type of the result will always be the data type of condition operand, which is a bit weird, and not what most people would expect. Just by switching the order ofcondition
andvalue
https://github.com/tenstorrent/tt-metal/blob/main/ttnn/cpp/ttnn/operations/eltwise/ternary/where.cpp#L37 leads to more expected result (though it might cause some other issues). I believettnn.where
is a bit special in that regard, even if you want to make case for strongly typed operations where mixed types are considered errors, while it's reasonable to assumetrue_value
andfalse_value
have the same data type, I believe thatcondition
's data type should be independent of them (and consequently the result's data type).The text was updated successfully, but these errors were encountered: