/* * Copyright (C) Cvitek Co., Ltd. 2019-2020. All rights reserved. */ #include #include #include #include #include #include class SoftmaxOpRuntime : public cvi::runtime::ICpuFunction { public: SoftmaxOpRuntime() = default; ~SoftmaxOpRuntime(); private: std::shared_ptr _bottom; std::shared_ptr _top; int _axis; int _inner_dim; int _dim; int _c; int _n; float *_max = nullptr; float *_sum = nullptr; public: static ICpuFunction *open() { return new SoftmaxOpRuntime(); } void setup(std::vector> &inputs, std::vector> &outputs, cvi::OpParam ¶m); void run(); };