changed formating to adaptive exponential format
This commit is contained in:
parent
5122c82869
commit
582bddc37a
1 changed files with 5 additions and 6 deletions
|
@ -1746,8 +1746,7 @@ void ggml_printTensorSample(const char *prefix, const struct ggml_tensor * tenso
|
|||
}
|
||||
|
||||
const char *sep = "+-------------------------------------------------------------------------------------------+\n";
|
||||
//printf("%s| Content of %s \"%s\" (%d dim)\n", sep, prefix, tensor->name, ggml_n_dims(tensor));
|
||||
|
||||
|
||||
const int MAX_ELEMENTS_ROW = 10;
|
||||
const int MAX_ELEMENTS_COL = 6;
|
||||
const int MAX_ELEMENTS_LAYER = 3; // layered
|
||||
|
@ -1765,7 +1764,7 @@ void ggml_printTensorSample(const char *prefix, const struct ggml_tensor * tenso
|
|||
if (n_dims == 1) {
|
||||
printf("| 1: ");
|
||||
for(int i = 0; i < tensor->ne[0] && i < MAX_ELEMENTS_ROW; i++){
|
||||
printf("%-7.4f, ", *(double *)((char *) tensor_data + i*tensor->nb[0]));
|
||||
printf("%11.3g, ", *(double *)((char *) tensor_data + i*tensor->nb[0]));
|
||||
}
|
||||
if(MAX_ELEMENTS_ROW < tensor->ne[0]) printf(", ..");
|
||||
printf("\n%s", sep);
|
||||
|
@ -1774,7 +1773,7 @@ void ggml_printTensorSample(const char *prefix, const struct ggml_tensor * tenso
|
|||
for(int i = 0; i < tensor->ne[0] && i < MAX_ELEMENTS_ROW; i++){
|
||||
printf("| %d: ", i+1);
|
||||
for(int j = 0; j < tensor->ne[1] && j < MAX_ELEMENTS_COL; j++){
|
||||
printf("%-7.4f ", *(double *)((char *) tensor_data + i*tensor->nb[0] + j*tensor->nb[1]));
|
||||
printf("%11.4g ", *(double *)((char *) tensor_data + i*tensor->nb[0] + j*tensor->nb[1]));
|
||||
if(j == MAX_ELEMENTS_COL - 1 && tensor->ne[1] > MAX_ELEMENTS_COL) printf(", ..");
|
||||
}
|
||||
printf("\n");
|
||||
|
@ -1787,7 +1786,7 @@ void ggml_printTensorSample(const char *prefix, const struct ggml_tensor * tenso
|
|||
for(int j = 0; j < tensor->ne[1] && j < MAX_ELEMENTS_COL; j++){
|
||||
printf("[");
|
||||
for(int k = 0; k < tensor->ne[2] && k < MAX_ELEMENTS_LAYER; k++){
|
||||
printf("%-7.4f", *(double *)((char *) tensor_data + i*tensor->nb[0] + j*tensor->nb[1] + k*tensor->nb[2]));
|
||||
printf("%11.4g", *(double *)((char *) tensor_data + i*tensor->nb[0] + j*tensor->nb[1] + k*tensor->nb[2]));
|
||||
if(k < tensor->ne[2] - 1 && k < MAX_ELEMENTS_LAYER - 1)
|
||||
printf(", ");
|
||||
}
|
||||
|
@ -1806,7 +1805,7 @@ void ggml_printTensorSample(const char *prefix, const struct ggml_tensor * tenso
|
|||
for(int j = 0; j < tensor->ne[2] && j < MAX_ELEMENTS_COL; j++){
|
||||
printf("[");
|
||||
for(int k = 0; k < tensor->ne[3] && k < MAX_ELEMENTS_LAYER; k++){
|
||||
printf("%-7.4f", *(double *)((char *) tensor_data + batch*tensor->nb[0] + i*tensor->nb[1] + j*tensor->nb[2] + k*tensor->nb[3]));
|
||||
printf("%11.4f", *(double *)((char *) tensor_data + batch*tensor->nb[0] + i*tensor->nb[1] + j*tensor->nb[2] + k*tensor->nb[3]));
|
||||
if(k < tensor->ne[3] - 1 && k < MAX_ELEMENTS_LAYER - 1)
|
||||
printf(", ");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue