36 std::map<std::string, tensor::Shape> &shape_ctx = context->
shape_ctx();
37 std::map<std::string, coco::Bag *> &bag_ctx = context->
bag_ctx();
39 assert(layer.bottom().size() == 1);
40 assert(layer.top().size() == 1);
44 assert(!layer.has_relu_param());
48 const auto ifm_name = layer.bottom(0);
49 const auto ifm_shape = shape_ctx.at(ifm_name);
50 auto ifm_bag = bag_ctx.at(ifm_name);
51 auto ifm_obj =
module->entity()->object()->create<coco::FeatureObject>();
53 ifm_obj->bag(ifm_bag);
56 const auto ofm_name = layer.top(0);
57 const auto ofm_shape = ifm_shape;
58 auto ofm_bag =
module->entity()->bag()->create(num_elements(ofm_shape));
59 auto ofm_obj =
module->entity()->object()->create<coco::FeatureObject>();
61 ofm_obj->bag(ofm_bag);
68 auto op =
module->entity()->op()->create<coco::ReLU>();
76 blk->instr()->append(ins);
79 bag_ctx[ofm_name] = ofm_bag;
80 shape_ctx[ofm_name] = ofm_shape;
ShapeContext & shape_ctx()