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

Method AddToGraph

tensorflow/core/kernels/data/captured_function.cc:388–409  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

386}
387
388Status CapturedFunction::AddToGraph(
389 SerializationContext* ctx, DatasetBase::DatasetGraphDefBuilder* b,
390 std::vector<Node*>* other_arguments,
391 DataTypeVector* other_arguments_types) const {
392 other_arguments->reserve(captured_inputs_.size());
393 other_arguments_types->reserve(captured_inputs_.size());
394 for (const Tensor& t : captured_inputs_) {
395 Node* node;
396 DatasetBase* input;
397 Status s = GetDatasetFromVariantTensor(t, &input);
398 if (s.ok()) {
399 TF_RETURN_IF_ERROR(b->AddInputDataset(ctx, input, &node));
400 } else {
401 TF_RETURN_IF_ERROR(b->AddTensor(t, &node));
402 }
403 other_arguments->emplace_back(node);
404 other_arguments_types->emplace_back(t.dtype());
405 }
406 TF_RETURN_IF_ERROR(
407 b->AddFunction(ctx, metadata_->func().name(), *metadata_->lib_def()));
408 return Status::OK();
409}
410
411Status CapturedFunction::Instantiate(
412 IteratorContext* ctx, std::unique_ptr<InstantiatedCapturedFunction>*

Callers 13

AsGraphDefInternalMethod · 0.80
AsGraphDefInternalMethod · 0.80
AsGraphDefInternalMethod · 0.80
AsGraphDefInternalMethod · 0.80
AsGraphDefInternalMethod · 0.80
AsGraphDefInternalMethod · 0.80
AsGraphDefInternalMethod · 0.80
AsGraphDefInternalMethod · 0.80
AsGraphDefInternalMethod · 0.80
AsGraphDefInternalMethod · 0.80
AsGraphDefInternalMethod · 0.80
AsGraphDefInternalMethod · 0.80

Calls 12

AddInputDatasetMethod · 0.80
nameMethod · 0.65
reserveMethod · 0.45
sizeMethod · 0.45
okMethod · 0.45
AddTensorMethod · 0.45
emplace_backMethod · 0.45
dtypeMethod · 0.45
AddFunctionMethod · 0.45
funcMethod · 0.45
lib_defMethod · 0.45

Tested by 1

AsGraphDefInternalMethod · 0.64