MCPcopy Create free account
hub / github.com/alibaba/MNN / onCompute

Method onCompute

source/geometry/GeometryTensorArray.cpp:83–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81class GeometryTensorArraySize : public GeometryComputer {
82public:
83 virtual bool onCompute(const Op* op, const std::vector<Tensor*>& inputs, const std::vector<Tensor*>& outputs,
84 Context& context, CommandBuffer& res) const override {
85 auto tensorArrayInput = inputs[1];
86 if (TensorUtils::getDescribe(tensorArrayInput)->tensorArrayAttr == nullptr) {
87 MNN_ASSERT(false);
88 return false;
89 }
90 if (!context.allocTensor(outputs[0])) {
91 return false;
92 }
93 outputs[0]->host<int>()[0] = TensorUtils::getDescribe(tensorArrayInput)->tensorArrayAttr->arraySize;
94 return true;
95 }
96};
97
98class GeometryTensorArrayRead : public GeometryComputer {

Callers

nothing calls this directly

Calls 1

allocTensorMethod · 0.80

Tested by

no test coverage detected