| 72 | } |
| 73 | |
| 74 | bool Decode(const VariantTensorData& data) { |
| 75 | if (data.type_name() != TypeName()) { |
| 76 | return false; |
| 77 | } |
| 78 | bool has_value = false; |
| 79 | if (!data.get_metadata(&has_value)) { |
| 80 | return false; |
| 81 | } |
| 82 | if (has_value) { |
| 83 | values_ = std::make_shared<std::vector<Tensor>>(data.tensors()); |
| 84 | } else { |
| 85 | values_.reset(); |
| 86 | } |
| 87 | return true; |
| 88 | } |
| 89 | |
| 90 | string DebugString() const { |
| 91 | if (values_) { |
nothing calls this directly
no test coverage detected