Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Short form for indexed tensors representing binary data requires "values" #30738

Open
jobergum opened this issue Mar 26, 2024 · 1 comment
Open
Assignees
Milestone

Comments

@jobergum
Copy link
Member

From doc

Short form for indexed tensors representing binary data (with int8 cell value type): May use a string with a hex dump of the cell values:

"tensorfield": "FF00118022FE"
can be used to represent the value tensor(x[6]):[-1,0,17,-128,34,-2].

But this fails

{ "put": "id:doc:doc::1", "fields": {"tensorfield":"FF00118022FE"}}
feed: got status 400 ({"pathId":"/document/v1/doc/doc/docid/1","message":"Error in document 'id:doc:doc::1' - could not parse field 'tensorfield' of type 'tensor<int8>(x[6])': Expected class 'com.yahoo.document.datatypes.TensorFieldValue', got 'java.lang.String'.: Expected class 'com.yahoo.document.datatypes.TensorFieldValue', got 'java.lang.String'."}) for put id:doc:doc::1: not retryable

However, the legacy format works.

{ "put": "id:doc:doc::1", "fields": {"tensorfield": { "values": "FF00118022FE"}}}
vespa document get id:doc:doc::1
{
    "pathId": "/document/v1/doc/doc/docid/1",
    "id": "id:doc:doc::1",
    "fields": {
        "tensorfield": {
            "type": "tensor<int8>(x[6])",
            "values": [
                -1,
                0,
                17,
                -128,
                34,
                -2
            ]
        }
    }
}
@geirst geirst added this to the soon milestone Apr 3, 2024
@geirst
Copy link
Member

geirst commented Apr 3, 2024

Please also add a system test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants