| 499 | } |
| 500 | |
| 501 | float GetLog2BufferSize(const Model& model, const string& array_id) { |
| 502 | auto& array = model.GetArray(array_id); |
| 503 | if (array.has_shape()) { |
| 504 | int buffer_size = 0; |
| 505 | if (IsNonEmpty(array.shape())) { |
| 506 | buffer_size = RequiredBufferSizeForShape(array.shape()); |
| 507 | return std::log2(static_cast<float>(buffer_size)); |
| 508 | } |
| 509 | } |
| 510 | return 0.0f; |
| 511 | } |
| 512 | |
| 513 | string GetOpId(int op_index) { return StringF("op%05d", op_index); } |
| 514 |
no test coverage detected