You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Question about multiple dimension string tensor using CXX api #1627
I'm creating a string tensor of two dimensions:
Since my onnx model requires one input of dimension [1,2] type ONNX_TENSOR_ELEMENT_DATA_TYPE_STRING.
For one string tensor input, I could validate the results as this link suggests. I'm wondering how I could get the created tensor and see the string value of each dimension? In other words, how could I use the api GetStringTensorContent for multiple dimension?
I'm not sure what you mean by each dimension. Calling GetStringTensorContent will return all elements of a string tensor. So for example, one with shape { 2, 3, 4 } will return 24 elements (with the same order as other basic type tensors).
Yes. You just answered my question. I'd like to make sure with the tensor I created:
I can get the tensor by running the codes below?
The string tensor will be returned in result?
Yes, in this case results will be a single concatenated string in result and the offsets vector holds the starts of each string (the length is just the start of one until the start of the next one).
Activity
RyanUnderhill commentedon Aug 15, 2019
I'm not sure what you mean by each dimension. Calling GetStringTensorContent will return all elements of a string tensor. So for example, one with shape { 2, 3, 4 } will return 24 elements (with the same order as other basic type tensors).
Or are you trying to get a subset of the tensor?
qw2208 commentedon Aug 16, 2019
Yes. You just answered my question. I'd like to make sure with the tensor I created:


I can get the tensor by running the codes below?
The string tensor will be returned in
result?RyanUnderhill commentedon Aug 19, 2019
Yes, in this case results will be a single concatenated string in
resultand theoffsetsvector holds the starts of each string (the length is just the start of one until the start of the next one).CI: Use latest stable ort in unit tests (#1627)