| 291 | } |
| 292 | |
| 293 | phi::IntArray MakePhiIntArrayFromVar(const framework::Variable& variable) { |
| 294 | if (variable.IsType<DenseTensor>()) { |
| 295 | const auto& tensor = variable.Get<DenseTensor>(); |
| 296 | return phi::IntArray(tensor); |
| 297 | } else { |
| 298 | PADDLE_THROW(common::errors::Unimplemented( |
| 299 | "Unsupported casting input `%s` type to IntArray when call pt " |
| 300 | "kernel.", |
| 301 | framework::ToTypeName(variable.Type()))); |
| 302 | } |
| 303 | } |
| 304 | |
| 305 | // TODO(chentianyu03): Inplace with IntArray constructor |
| 306 | phi::IntArray MakePhiIntArrayFromVarList( |
no test coverage detected