STYLE: minor refactor
This commit is contained in:
parent
c04966cda6
commit
96ba47dd43
|
|
@ -199,6 +199,7 @@ void GgmlOvDecoder::dump_cgraph(const struct ggml_cgraph* cgraph) {
|
|||
|
||||
file << "=== GRAPH ===\n";
|
||||
|
||||
// clang-format off
|
||||
file << "n_nodes = " << cgraph->n_nodes << "\n";
|
||||
file << " " << std::setw(3) << "nodes"
|
||||
<< std::setw(15) << "shape"
|
||||
|
|
@ -225,53 +226,23 @@ void GgmlOvDecoder::dump_cgraph(const struct ggml_cgraph* cgraph) {
|
|||
<< std::setw(5) << node->nb[3] << "] "
|
||||
<< "\n";
|
||||
|
||||
if (node->src[0]) {
|
||||
file << std::setw(10) << " [ "
|
||||
<< std::setw(5) << node->src[0]->ne[0] << ", "
|
||||
<< std::setw(5) << node->src[0]->ne[1] << ", "
|
||||
<< std::setw(5) << node->src[0]->ne[2] << ", "
|
||||
<< std::setw(5) << node->src[0]->ne[3] << "] "
|
||||
<< std::setw(12)
|
||||
<< "0: " << std::left << std::setw(12) << ggml_op_name(node->src[0]->op) << std::right;
|
||||
file << std::left << std::setw(30) << node->src[0]->name << std::right
|
||||
<< std::setw(16) << "[ "
|
||||
<< std::setw(0) << node->src[0]->nb[0] << ", "
|
||||
<< std::setw(5) << node->src[0]->nb[1] << ", "
|
||||
<< std::setw(5) << node->src[0]->nb[2] << ", "
|
||||
<< std::setw(5) << node->src[0]->nb[3] << "] "
|
||||
<< "\n";
|
||||
}
|
||||
if (node->src[1]) {
|
||||
file << std::setw(10) << " [ "
|
||||
<< std::setw(5) << node->src[1]->ne[0] << ", "
|
||||
<< std::setw(5) << node->src[1]->ne[1] << ", "
|
||||
<< std::setw(5) << node->src[1]->ne[2] << ", "
|
||||
<< std::setw(5) << node->src[1]->ne[3] << "] "
|
||||
<< std::setw(12)
|
||||
<< "1: " << std::left << std::setw(12) << ggml_op_name(node->src[1]->op) << std::right;
|
||||
file << std::left << std::setw(30) << node->src[1]->name << std::right
|
||||
<< std::setw(16) << "[ "
|
||||
<< std::setw(0) << node->src[1]->nb[0] << ", "
|
||||
<< std::setw(5) << node->src[1]->nb[1] << ", "
|
||||
<< std::setw(5) << node->src[1]->nb[2] << ", "
|
||||
<< std::setw(5) << node->src[1]->nb[3] << "] "
|
||||
<< "\n";
|
||||
}
|
||||
if (node->src[2]) {
|
||||
file << std::setw(10) << " [ "
|
||||
<< std::setw(5) << node->src[2]->ne[0] << ", "
|
||||
<< std::setw(5) << node->src[2]->ne[1] << ", "
|
||||
<< std::setw(5) << node->src[2]->ne[2] << ", "
|
||||
<< std::setw(5) << node->src[2]->ne[3] << "] "
|
||||
<< std::setw(12)
|
||||
<< "2: " << std::left << std::setw(12) << ggml_op_name(node->src[1]->op) << std::right;
|
||||
file << std::left << std::setw(30) << node->src[2]->name << std::right
|
||||
<< std::setw(16) << "[ "
|
||||
<< std::setw(0) << node->src[2]->nb[0] << ", "
|
||||
<< std::setw(5) << node->src[2]->nb[1] << ", "
|
||||
<< std::setw(5) << node->src[2]->nb[2] << ", "
|
||||
<< std::setw(5) << node->src[2]->nb[3] << "] "
|
||||
<< "\n";
|
||||
for (int i = 0; i < GGML_MAX_SRC; i++) {
|
||||
if (auto* src = node->src[i]) {
|
||||
file << std::setw(10) << " [ "
|
||||
<< std::setw(5) << src->ne[0] << ", "
|
||||
<< std::setw(5) << src->ne[1] << ", "
|
||||
<< std::setw(5) << src->ne[2] << ", "
|
||||
<< std::setw(5) << src->ne[3] << "] "
|
||||
<< std::setw(12)
|
||||
<< i << ": " << std::left << std::setw(12) << ggml_op_name(src->op) << std::right;
|
||||
file << std::left << std::setw(30) << src->name << std::right
|
||||
<< std::setw(16) << "[ "
|
||||
<< std::setw(0) << src->nb[0] << ", "
|
||||
<< std::setw(5) << src->nb[1] << ", "
|
||||
<< std::setw(5) << src->nb[2] << ", "
|
||||
<< std::setw(5) << src->nb[3] << "] "
|
||||
<< "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -285,7 +256,7 @@ void GgmlOvDecoder::dump_cgraph(const struct ggml_cgraph* cgraph) {
|
|||
<< std::setw(8) << ggml_op_name(node->op) << " "
|
||||
<< std::setw(16) << ggml_get_name(node) << "\n";
|
||||
}
|
||||
|
||||
// clang-format on
|
||||
file << "========================================\n";
|
||||
|
||||
file.close();
|
||||
|
|
|
|||
Loading…
Reference in New Issue