MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / MutableHashTableShape

Function MutableHashTableShape

tensorflow/core/ops/lookup_ops.cc:316–334  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

314 });
315
316Status 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
336REGISTER_OP("HashTable")
337 .Output("table_handle: Ref(string)")

Callers 1

lookup_ops.ccFile · 0.85

Calls 5

WithRankAtMostMethod · 0.80
set_outputMethod · 0.45
ScalarMethod · 0.45
GetAttrMethod · 0.45

Tested by

no test coverage detected