| 38 | namespace paddle::experimental { |
| 39 | |
| 40 | inline bool NeedTransformDataType(const DataType& input, |
| 41 | const DataType& target, |
| 42 | const TransformFlag& transform_flag) { |
| 43 | return input != target && |
| 44 | (transform_flag.need_trans_data_type() || |
| 45 | ((target == DataType::COMPLEX64 || target == DataType::COMPLEX128) && |
| 46 | (input != DataType::INT32 && input != DataType::INT64 && |
| 47 | input != DataType::BOOL))); |
| 48 | } |
| 49 | |
| 50 | inline bool NeedTransformLayout(const DataLayout& input, |
| 51 | const DataLayout& target, |
no test coverage detected