| 41 | } |
| 42 | |
| 43 | int get_tensor_mem_size(const Tensor* tensor) |
| 44 | { |
| 45 | if(tensor->GetType() == kConstTensor) |
| 46 | return tensor->GetTotalSize(); |
| 47 | |
| 48 | TensorMemPtr ptr; |
| 49 | |
| 50 | if(get_tensor_memptr(tensor, ptr) && ptr.get() != nullptr) |
| 51 | return ptr.get()->GetSize(); |
| 52 | else |
| 53 | return 0; |
| 54 | } |
| 55 | |
| 56 | bool get_tensor_memptr(const Tensor* tensor, TensorMemPtr& ptr) |
| 57 | { |
no test coverage detected