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

Method Encode

tensorflow/core/kernels/data/optional_ops.h:65–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63 // objects in DT_VARIANT tensors.
64 string TypeName() const { return kOptionalVariantTypeName; }
65 void Encode(VariantTensorData* data) const {
66 data->set_metadata(values_ != nullptr);
67 if (values_ != nullptr) {
68 for (const auto& t : *values_) {
69 *(data->add_tensors()) = t;
70 }
71 }
72 }
73
74 bool Decode(const VariantTensorData& data) {
75 if (data.type_name() != TypeName()) {

Callers

nothing calls this directly

Calls 2

set_metadataMethod · 0.45
add_tensorsMethod · 0.45

Tested by

no test coverage detected