Skip to content

bug: slice JSON output hardcodes shape to [count] instead of actual tensor shape #519

@noahgift

Description

@noahgift

Bug

In crates/apr-cli/src/commands/slice.rs, the output_slice_result() function hardcodes the JSON shape field as [count] (line 193), discarding the actual tensor shape.

The slice_gguf() function retrieves the real shape (line 112: let (data, shape) = get_gguf_tensor_f32(...)) but then explicitly discards it (line 134: let _ = shape;).

Impact

When slicing a 2D tensor [768, 3072] and extracting elements 0..10, JSON output shows:

{"shape": [10], ...}

instead of:

{"shape": [768, 3072], "slice_count": 10, ...}

Fix

Pass the actual tensor shape through to output_slice_result() and include it in JSON output alongside slice count.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions