| 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()) { |
nothing calls this directly
no test coverage detected