| 190 | } |
| 191 | |
| 192 | void TF_TensorBitcastFrom(const TF_Tensor* from, TF_DataType type, |
| 193 | TF_Tensor* to, const int64_t* new_dims, |
| 194 | int num_new_dims, TF_Status* status) { |
| 195 | TF_SetStatus(status, TF_OK, ""); |
| 196 | tensorflow::TensorShape s; |
| 197 | for (int i = 0; i < num_new_dims; ++i) { |
| 198 | s.AddDim(new_dims[i]); |
| 199 | } |
| 200 | Status cc_status(to->tensor.BitcastFrom( |
| 201 | from->tensor, static_cast<tensorflow::DataType>(type), s)); |
| 202 | Set_TF_Status_from_Status(status, cc_status); |
| 203 | } |
| 204 | |
| 205 | // -------------------------------------------------------------------------- |
| 206 | size_t TF_StringEncode(const char* src, size_t src_len, char* dst, |