| 69 | } |
| 70 | |
| 71 | void FreeTensor(void) |
| 72 | { |
| 73 | if(type_ == kConstTensor && ExistAttr("free_mem") && ExistAttr("mem_addr")) |
| 74 | { |
| 75 | void* mem = any_cast<void*>(GetAttr("mem_addr")); |
| 76 | std::free(mem); |
| 77 | |
| 78 | RemoveAttr("free_mem"); |
| 79 | RemoveAttr("mem_addr"); |
| 80 | } |
| 81 | } |
| 82 | |
| 83 | Tensor(const Tensor& o) |
| 84 | : BaseObject(o), producer(o.producer), consumer(o.consumer), quant_param_(o.quant_param_), type_(o.type_), |