onnxruntime/java/src
Adam Pocock ef11032c89
[java] Allows the creation and extraction of zero length tensors (#15116)
### Description
Allows the creation of zero length tensors via the buffer path (the
array path with zero length arrays still throws as the validation logic
to check it's not ragged would require more intrusive revision), and
allows the `tensor.getValue()` method to return a Java multidimensional
array with a zero dimension. Also added a test for the creation and
extraction behaviour.

### Motivation and Context
The Python interface can return zero length tensors (e.g. if object
detection doesn't find any objects), and before this PR in Java calling
`tensor.getValue()` throws an exception with a confusing error message.
Fixes #7270 & #15107.
2023-04-05 10:49:59 -07:00
..
main [java] Allows the creation and extraction of zero length tensors (#15116) 2023-04-05 10:49:59 -07:00
test [java] Allows the creation and extraction of zero length tensors (#15116) 2023-04-05 10:49:59 -07:00