| 419 | |
| 420 | template <> |
| 421 | Status DoCopy(const CPUDevice& device, const Tensor& x, Tensor* y) { |
| 422 | CHECK_EQ(x.dtype(), y->dtype()); |
| 423 | switch (x.dtype()) { |
| 424 | #define CASE(type) \ |
| 425 | case DataTypeToEnum<type>::value: \ |
| 426 | y->flat<type>().device(device) = x.flat<type>(); \ |
| 427 | break; |
| 428 | |
| 429 | TF_CALL_NUMBER_TYPES(CASE); |
| 430 | TF_CALL_bool(CASE); |
| 431 | TF_CALL_tstring(CASE); |
| 432 | #undef CASE |
| 433 | default: |
| 434 | return errors::InvalidArgument("Unsupported data type: ", |
| 435 | DataTypeString(x.dtype())); |
| 436 | } |
| 437 | return Status::OK(); |
| 438 | } |
| 439 | |
| 440 | } // end namespace functor |
| 441 |
no test coverage detected