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

Method AddInputDataset

tensorflow/core/framework/dataset.cc:369–389  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

367}
368
369Status DatasetBase::DatasetGraphDefBuilder::AddInputDataset(
370 SerializationContext* ctx, const DatasetBase* dataset, Node** output) {
371 Status status = dataset->AsGraphDefInternal(ctx, this, output);
372 if (errors::IsUnimplemented(status) && !ctx->fail_if_unimplemented()) {
373 Tensor t(DT_VARIANT, TensorShape({}));
374 // `StoreDatasetInVariantTensor` will transfer ownership of `dataset`. We
375 // increment the refcount of `dataset` here to retain ownership.
376 dataset->Ref();
377 TF_RETURN_IF_ERROR(
378 StoreDatasetInVariantTensor(const_cast<DatasetBase*>(dataset), &t));
379 TF_RETURN_IF_ERROR(AddPlaceholder(t, output));
380 DCHECK_NE(ctx->input_list(), nullptr);
381 ctx->input_list()->emplace_back((*output)->name(), std::move(t));
382 LOG(WARNING)
383 << "Input of " << dataset->DebugString()
384 << " will not be optimized because the dataset does not implement the "
385 "AsGraphDefInternal() method needed to apply optimizations.";
386 return Status::OK();
387 }
388 return status;
389}
390
391Status DatasetBaseIterator::GetNext(IteratorContext* ctx,
392 std::vector<Tensor>* out_tensors,

Callers 15

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 11

IsUnimplementedFunction · 0.85
fail_if_unimplementedMethod · 0.80
TensorShapeClass · 0.70
nameMethod · 0.65
AddPlaceholderFunction · 0.50
AsGraphDefInternalMethod · 0.45
RefMethod · 0.45
input_listMethod · 0.45
emplace_backMethod · 0.45
DebugStringMethod · 0.45

Tested by 2

AsGraphDefInternalMethod · 0.64
AsGraphDefInternalMethod · 0.64