| 25 | |
| 26 | template<typename To, typename Ti> |
| 27 | Array<To> real(const Array<Ti> &in) { |
| 28 | common::Node_ptr in_node = in.getNode(); |
| 29 | common::UnaryNode *node = |
| 30 | new common::UnaryNode(static_cast<af::dtype>(dtype_traits<To>::af_type), |
| 31 | "__creal", in_node, af_real_t); |
| 32 | |
| 33 | return createNodeArray<To>(in.dims(), common::Node_ptr(node)); |
| 34 | } |
| 35 | |
| 36 | template<typename To, typename Ti> |
| 37 | Array<To> imag(const Array<Ti> &in) { |