Copies the index^th slice of parent (in the 0th dimension) into element.
| 160 | |
| 161 | // Copies the index^th slice of parent (in the 0th dimension) into element. |
| 162 | Status CopySliceToElement(const Tensor& parent, Tensor* element, int64 index) { |
| 163 | TF_RETURN_IF_ERROR(ValidateInput(parent, *element, index)); |
| 164 | |
| 165 | #define HANDLE_TYPE(T) \ |
| 166 | case DataTypeToEnum<T>::value: { \ |
| 167 | HandleSliceToElement<T>(parent, element, index); \ |
| 168 | return Status::OK(); \ |
| 169 | } |
| 170 | |
| 171 | switch (parent.dtype()) { |
| 172 | TF_CALL_ALL_TYPES(HANDLE_TYPE); |
| 173 | TF_CALL_QUANTIZED_TYPES(HANDLE_TYPE); |
| 174 | TF_CALL_uint32(HANDLE_TYPE); |
| 175 | TF_CALL_uint64(HANDLE_TYPE); |
| 176 | #undef HANDLE_TYPE |
| 177 | default: |
| 178 | return errors::Unimplemented("CopySliceToElement Unhandled data type: ", |
| 179 | element->dtype()); |
| 180 | } |
| 181 | } |
| 182 | |
| 183 | // Copies the index^th slice of parent (in the 0th dimension) into element. |
| 184 | // |
no test coverage detected