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

Function MakeTensor

tensorflow/lite/delegates/flex/buffer_map_test.cc:78–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76
77template <typename T>
78tensorflow::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
86std::vector<tensorflow::int64> GetTensorShape(const tensorflow::Tensor& t) {
87 std::vector<tensorflow::int64> shape(t.dims());

Callers 1

SetFromTfLiteMethod · 0.70

Calls 3

SetFromTfLiteMethod · 0.80
getMethod · 0.45
GetTensorMethod · 0.45

Tested by

no test coverage detected