| 237 | class GeometrySize : public GeometryComputer { |
| 238 | public: |
| 239 | virtual bool onCompute(const Op* op, const std::vector<Tensor*>& inputs, const std::vector<Tensor*>& outputs, |
| 240 | Context& context, CommandBuffer& res) const override { |
| 241 | if (nullptr == TensorUtils::getDescribeOrigin(outputs[0])->mem.get()) { |
| 242 | if(!context.allocTensor(outputs[0])) { |
| 243 | return false; |
| 244 | } |
| 245 | } |
| 246 | int count = 1; |
| 247 | for (int i = 0; i < inputs[0]->buffer().dimensions; i++) { |
| 248 | count *= inputs[0]->buffer().dim[i].extent; |
| 249 | } |
| 250 | outputs[0]->host<int>()[0] = count; |
| 251 | return true; |
| 252 | } |
| 253 | }; |
| 254 | |
| 255 | class GeometryRaster : public GeometryComputer { |
nothing calls this directly
no test coverage detected