Commit f41abee5 authored by Shucai Xiao's avatar Shucai Xiao
Browse files

code backup

parent 5246b8d7
...@@ -23,14 +23,14 @@ struct capture ...@@ -23,14 +23,14 @@ struct capture
template <class Self, class F> template <class Self, class F>
static auto reflect(Self& self, F f) static auto reflect(Self& self, F f)
{ {
return pack(f(self.f, "func")); return pack(f(self.ins_index, "instruction_index"));
} }
std::string name() const { return "capputure"; } std::string name() const { return "capputure"; }
shape compute_shape(std::vector<shape> inputs) const { return inputs.front(); } shape compute_shape(std::vector<shape> inputs) const { return inputs.front(); }
argument compute(const shape& output_shape, std::vector<argument> args) const argument compute(const shape&, std::vector<argument> args) const
{ {
f(ins_index, args); f(ins_index, args);
return args.front(); return args.front();
......
...@@ -107,7 +107,7 @@ void quantize(program& prog) { quantize(prog, {"all"}); } ...@@ -107,7 +107,7 @@ void quantize(program& prog) { quantize(prog, {"all"}); }
std::vector<std::vector<argument>> ins_args; std::vector<std::vector<argument>> ins_args;
void capture_args(std::size_t ins_index, std::vector<argument> args) void capture_args(std::size_t ins_index, std::vector<argument> args)
{ {
if(ins_index = ins_args.size()) if(ins_index == ins_args.size())
{ {
ins_args.push_back(std::vector<argument>{}); ins_args.push_back(std::vector<argument>{});
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment