Skip to content

model-conversion : add option to print tensor values#19692

Merged
danbev merged 1 commit intoggml-org:masterfrom
danbev:model-conversion-print-tensor-values
Feb 17, 2026
Merged

model-conversion : add option to print tensor values#19692
danbev merged 1 commit intoggml-org:masterfrom
danbev:model-conversion-print-tensor-values

Conversation

@danbev
Copy link
Copy Markdown
Member

@danbev danbev commented Feb 17, 2026

This commit updates the tensor-info.py script to support the option to print the first N values of a tensor when displaying its information.

The motivation for this is that it can be useful to inspect some actual values in addition to the shapes of the tensors.


Example usage:

./scripts/utils/tensor-info.py -m ~/work/models/moonshotai/Kimi-Linear model.layers.0.self_attn.A_log -n 32

Tensor: model.layers.0.self_attn.A_log
File:   model-00001-of-00020.safetensors
Shape:  [1, 1, 32, 1]
Dtype:  torch.float32
Values: [1.103968620300293, -0.20674507319927216, 0.06409236788749695, 2.277034282684326, 3.3999674320220947, 4.209522724151611, 1.915040135383606, 3.1779892444610596, 3.0966317653656006, 1.5971810817718506, 4.7506303787231445, -0.4733889102935791, 2.5522594451904297, 5.304281234741211, -0.31161242723464966, 2.7692441940307617, 2.7018637657165527, 2.3136250972747803, 1.659307837486267, 3.121227741241455, -1.488243579864502, 2.63500714302063, -0.8697880506515503, 3.5412185192108154, 2.9536848068237305, 2.9326748847961426, 2.8871192932128906, 2.265052080154419, 3.379794120788574, 2.962221622467041, 3.7428195476531982, 3.0271267890930176]

This commit updates the tensor-info.py script to support the option to
print the first N values of a tensor when displaying its information.

The motivation for this is that it can be useful to inspect some actual
values in addition to the shapes of the tensors.
@github-actions github-actions Bot added examples python python script changes labels Feb 17, 2026
@danbev danbev merged commit 2b089c7 into ggml-org:master Feb 17, 2026
4 checks passed
@danbev danbev deleted the model-conversion-print-tensor-values branch February 19, 2026 09:05
liparetejas pushed a commit to liparetejas/llama.cpp that referenced this pull request Feb 23, 2026
This commit updates the tensor-info.py script to support the option to
print the first N values of a tensor when displaying its information.

The motivation for this is that it can be useful to inspect some actual
values in addition to the shapes of the tensors.
bartowski1182 pushed a commit to bartowski1182/llama.cpp that referenced this pull request Mar 2, 2026
This commit updates the tensor-info.py script to support the option to
print the first N values of a tensor when displaying its information.

The motivation for this is that it can be useful to inspect some actual
values in addition to the shapes of the tensors.
ArberSephirotheca pushed a commit to ArberSephirotheca/llama.cpp that referenced this pull request Mar 3, 2026
This commit updates the tensor-info.py script to support the option to
print the first N values of a tensor when displaying its information.

The motivation for this is that it can be useful to inspect some actual
values in addition to the shapes of the tensors.
Seunghhon pushed a commit to Seunghhon/llama.cpp that referenced this pull request Apr 26, 2026
This commit updates the tensor-info.py script to support the option to
print the first N values of a tensor when displaying its information.

The motivation for this is that it can be useful to inspect some actual
values in addition to the shapes of the tensors.
rsenthilkumar6 pushed a commit to rsenthilkumar6/llama.cpp that referenced this pull request May 1, 2026
This commit updates the tensor-info.py script to support the option to
print the first N values of a tensor when displaying its information.

The motivation for this is that it can be useful to inspect some actual
values in addition to the shapes of the tensors.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

examples python python script changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants