#pragma once #include "core/operator.h" #include "nnet/expr.h" namespace infini { class MemBoundObj : public OperatorObj { private: std::vector nnetInputs; nnet::Expr expr, simplifiedExpr; double exec_time; std::string hint; HashType hash, simplifiedHash; int n, f, h, w; public: MemBoundObj(GraphObj *graph, const TensorVec &input, const TensorVec &output, const std::vector &nnetInputs, nnet::Expr expr, double exec_time, std::string hint = {}); OP_CLONE(MemBoundObj); std::string toString() const override; optional> inferShape(const TensorVec &inputs) const override; int numInputs() const override { return inputs.size(); } int numOutputs() const override { return outputs.size(); } const vector &getNnetInputs() const { return nnetInputs; } const nnet::Expr getNnetExpr() const { return expr; } pair getSimplifiedNnetExpr() const { return {expr, hash}; } private: vector getWorkloadVector() const override; vector getOpAttrVector() const override; static HashType calcHash(nnet::Expr expr); static bool checkOOB(nnet::Expr expr); }; } // namespace infini