| 500 | } |
| 501 | |
| 502 | void LogArray(int log_level, const Model& model, const string& name) { |
| 503 | VLOG(log_level) << "Array: " << name; |
| 504 | if (!model.HasArray(name)) { |
| 505 | VLOG(log_level) << " DOES NOT EXIST"; |
| 506 | return; |
| 507 | } |
| 508 | const auto& array = model.GetArray(name); |
| 509 | VLOG(log_level) << " Data type: " << ArrayDataTypeName(array.data_type); |
| 510 | VLOG(log_level) << " Final type: " |
| 511 | << ArrayDataTypeName(array.final_data_type); |
| 512 | if (array.buffer) { |
| 513 | VLOG(log_level) << " Constant Buffer"; |
| 514 | } |
| 515 | if (array.alloc) { |
| 516 | VLOG(log_level) << " Transient Alloc"; |
| 517 | } |
| 518 | if (array.has_shape()) { |
| 519 | const Shape& array_shape = array.shape(); |
| 520 | if (array_shape.dimensions_count() == 0) { |
| 521 | VLOG(log_level) << " (Zero dimensions)"; |
| 522 | } else { |
| 523 | string message = " Dims: "; |
| 524 | bool first = true; |
| 525 | for (const int dim : array_shape.dims()) { |
| 526 | if (!first) { |
| 527 | message += ", "; |
| 528 | } |
| 529 | first = false; |
| 530 | toco::port::AppendF(&message, "%d", dim); |
| 531 | } |
| 532 | VLOG(log_level) << message; |
| 533 | } |
| 534 | } |
| 535 | if (array.minmax) { |
| 536 | VLOG(log_level) << " MinMax: " << array.minmax->min << " .. " |
| 537 | << array.minmax->max; |
| 538 | } |
| 539 | if (array.quantization_params) { |
| 540 | VLOG(log_level) << " QuantizationParams: zero_point=" |
| 541 | << static_cast<int>(array.quantization_params->zero_point) |
| 542 | << ", scale=" << array.quantization_params->scale; |
| 543 | } |
| 544 | } |
| 545 | |
| 546 | void DumpGraphvizVideoFrame(const Model& model) { |
| 547 | namespace port = toco::port; |
no test coverage detected