| 76 | |
| 77 | template <typename T> |
| 78 | tensorflow::Tensor MakeTensor(const std::vector<int>& shape, |
| 79 | const std::vector<T>& data) { |
| 80 | BufferMap buffer_map; // BufferMap is the easiest way to build the tensor. |
| 81 | UniqueTfLiteTensor t1 = MakeLiteTensor<T>(shape, data); |
| 82 | buffer_map.SetFromTfLite(0, t1.get()); |
| 83 | return buffer_map.GetTensor(0); |
| 84 | } |
| 85 | |
| 86 | std::vector<tensorflow::int64> GetTensorShape(const tensorflow::Tensor& t) { |
| 87 | std::vector<tensorflow::int64> shape(t.dims()); |
no test coverage detected