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

Method SingleOpModel

tensorflow/lite/delegates/gpu/gl/kernels/test_util.cc:39–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37namespace gl {
38
39SingleOpModel::SingleOpModel(Operation&& operation,
40 const std::vector<TensorRef<BHWC>>& inputs,
41 const std::vector<TensorRef<BHWC>>& outputs) {
42 auto node = graph_.NewNode();
43 node->operation = std::move(operation);
44
45 for (int i = 0; i < inputs.size(); ++i) {
46 auto input = graph_.NewValue();
47 input->tensor = inputs[i];
48 graph_.AddConsumer(node->id, input->id).IgnoreError();
49 TensorFloat32 tensor;
50 tensor.id = input->tensor.ref;
51 tensor.shape = input->tensor.shape;
52 inputs_.emplace_back(std::move(tensor));
53 }
54
55 for (int i = 0; i < outputs.size(); ++i) {
56 auto output = graph_.NewValue();
57 output->tensor = outputs[i];
58 graph_.SetProducer(node->id, output->id).IgnoreError();
59 }
60}
61
62bool SingleOpModel::PopulateTensor(int index, std::vector<float>&& data) {
63 if (index >= inputs_.size() ||

Callers

nothing calls this directly

Calls 7

NewValueMethod · 0.80
AddConsumerMethod · 0.80
NewNodeMethod · 0.45
sizeMethod · 0.45
IgnoreErrorMethod · 0.45
emplace_backMethod · 0.45
SetProducerMethod · 0.45

Tested by

no test coverage detected