| 74 | }; |
| 75 | |
| 76 | static inline phi::TensorArgDef GetKernelInputArgDef( |
| 77 | const phi::TensorArgDef& input_def, phi::Backend kernel_backend) { |
| 78 | phi::TensorArgDef input_actual_def = input_def; |
| 79 | #ifdef PADDLE_WITH_CUSTOM_DEVICE |
| 80 | // When the backend of input tensor arg_def is CUSTOM, we need to set it to |
| 81 | // the actual backend by expected_kernel_key. |
| 82 | if (input_actual_def.backend == phi::Backend::CUSTOM) { |
| 83 | input_actual_def.SetBackend(kernel_backend); |
| 84 | } |
| 85 | #endif |
| 86 | return input_actual_def; |
| 87 | } |
| 88 | |
| 89 | std::shared_ptr<phi::DenseTensor> PrepareData( |
| 90 | const Tensor& input, |
no outgoing calls
no test coverage detected