| 314 | }); |
| 315 | |
| 316 | Status MutableHashTableShape(InferenceContext* c, const ShapeHandle& key, |
| 317 | const ShapeHandle& value) { |
| 318 | c->set_output(0, c->Scalar()); |
| 319 | |
| 320 | ShapeHandle key_s; |
| 321 | TF_RETURN_IF_ERROR(c->WithRankAtMost(key, 1, &key_s)); |
| 322 | |
| 323 | DataType key_t; |
| 324 | TF_RETURN_IF_ERROR(c->GetAttr("key_dtype", &key_t)); |
| 325 | |
| 326 | DataType value_t; |
| 327 | TF_RETURN_IF_ERROR(c->GetAttr("value_dtype", &value_t)); |
| 328 | |
| 329 | // ShapeAndType vector for {key, value}. |
| 330 | c->set_output_handle_shapes_and_types( |
| 331 | 0, std::vector<ShapeAndType>{{key_s, key_t}, {value, value_t}}); |
| 332 | |
| 333 | return Status::OK(); |
| 334 | } |
| 335 | |
| 336 | REGISTER_OP("HashTable") |
| 337 | .Output("table_handle: Ref(string)") |
no test coverage detected