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

Class DatasetContext

tensorflow/core/framework/dataset.h:613–633  ·  view source on GitHub ↗

Represents runtime information needed to construct a dataset.

Source from the content-addressed store, hash-verified

611
612// Represents runtime information needed to construct a dataset.
613class DatasetContext {
614 public:
615 struct Params {
616 string type_string; // op type name of this dataset.
617 string node_name; // graph node name of this dataset op, uniquely
618 // identifying the dataset in the graph.
619 };
620
621 explicit DatasetContext(Params params) : params_(std::move(params)) {}
622
623 explicit DatasetContext(OpKernelContext* ctx) {
624 params_.type_string = ctx->op_kernel().type_string();
625 params_.node_name = ctx->op_kernel().name();
626 }
627
628 const string& type_string() const { return params_.type_string; }
629 const string& node_name() const { return params_.node_name; }
630
631 private:
632 Params params_;
633};
634
635// Returns the number of bytes allocated for the given tensor.
636int64 GetAllocatedBytes(const std::vector<Tensor>& element);

Callers 15

DatasetMethod · 0.85
DatasetMethod · 0.85
DatasetMethod · 0.85
DatasetMethod · 0.85
DatasetMethod · 0.85
DatasetMethod · 0.85
DatasetMethod · 0.85
DatasetMethod · 0.85
DatasetMethod · 0.85
IgniteDatasetMethod · 0.85
DatasetMethod · 0.85
DatasetMethod · 0.85

Calls

no outgoing calls

Tested by 3

WrapperDatasetMethod · 0.68
DatasetMethod · 0.68
DatasetMethod · 0.68