| 172 | |
| 173 | namespace { |
| 174 | void MakeCallableHelper(tensorflow::Session* session, |
| 175 | const TF_Buffer* callable_options, int64_t* out_handle, |
| 176 | TF_Status* out_status) { |
| 177 | tensorflow::CallableOptions callable_options_proto; |
| 178 | if (callable_options != nullptr && |
| 179 | !callable_options_proto.ParseFromArray(callable_options->data, |
| 180 | callable_options->length)) { |
| 181 | Set_TF_Status_from_Status( |
| 182 | out_status, |
| 183 | errors::InvalidArgument("Unparseable CallableOptions proto")); |
| 184 | return; |
| 185 | } |
| 186 | tensorflow::Session::CallableHandle handle; |
| 187 | Status s = session->MakeCallable(callable_options_proto, &handle); |
| 188 | if (!s.ok()) { |
| 189 | Set_TF_Status_from_Status(out_status, s); |
| 190 | return; |
| 191 | } |
| 192 | *out_handle = handle; |
| 193 | } |
| 194 | } // namespace |
| 195 | |
| 196 | void TF_DeprecatedSessionMakeCallable(TF_DeprecatedSession* session, |
no test coverage detected