question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to concatenate strings in ONNX?

See original GitHub issue

Ask a Question

Question

We have a use case where we would like to concatenate string tensor pairwise. Here is some pseudo code of what I’m trying to accomplish:

tensor1 = ["a", "b", "c"]
tensor2 = ["d", "e", "f"]

concat(tensor1, tensor2)
> ["ad", "be", "cf"]

# Should also support broadcasting
concat(tensor1, "g")
> ["ag", "bg", "cg"]

The existing concat is not helping me, as it only concats the tensor into a tensor of a higher rank instead of concatenating the strings.

Is it possible to accomplish this with the current ONNX operator set?

Further information

  • Relevant Area (e.g. model usage, backend, best practices, converters, shape_inference, version_converter, training, test, operators):

  • Is this issue related to a specific model? No.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
AlexandreEichenbergercommented, Sep 8, 2021

FYI this feature is one that is being requested in the ONNX Roadmap discussion. https://onnx.ai/news.html#new60

It will be discussed Sept 8th at 9pm EST Sept 8th (5:30 to 6pm – PST)

  1. Takuya Nakaike (IBM) – New operators for data processing to cover ML pipeline (eg: Stringconcatenator, Stringsplitter, Date)
  2. Adam Pocock (Oracle labs) – C API for C++ components of ONNX (to assist in wrapper for model checker functionality)
  3. Adam Pocock (Oracle labs) – Better support for emitting ONNX models from other languages beyond Python

Check the link above on how to join.

0reactions
janjaguschcommented, Sep 10, 2021

https://www.youtube.com/watch?v=RJKXRgfKjkQ

Thanks! I will close this issue for now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Concat — Python Runtime for ONNX
Concatenate a list of tensors into a single tensor. All input tensors must have the same shape, except for the dimension size of...
Read more >
onnx/Operators.md at main - GitHub
Concatenate a sequence of tensors into a single tensor. All input tensors must have the same shape, except for the dimension size of...
Read more >
Concat - 1 vs 11 — ONNX 1.12.0 documentation
- Concatenate a list of tensors into a single tensor . All input tensors must have the same shape, except for the dimension...
Read more >
Merging ONNX graphs - Towards Data Science
Join, Merge, Split, and concatenate ONNX graphs using sclblonnx. ONNX is getting more and more popular. While initially conceived predominantly ...
Read more >
ONNX Operators for Regex Replacements - Stack Overflow
Use the OnnxUnique operator and it's inverse_indicies property to translate the input string to something approximating each character's ASCII ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found