mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-15 20:50:42 +00:00
### Description Adds a method to access the backing direct byte buffer from a Java `OnnxTensor` object, assuming it is backed by a direct byte buffer (tensors created by ORT's run call or ones created in Java from multidimensional arrays are not). Also adds a method to check if the backing byte buffer was copied from the user's buffer supplied on creation (this could be tested via a pointer comparison from the output of `getBufferRef` and the user's input buffer, so I'm not sure if it's necessary). ### Motivation and Context This is the first part of changes necessary to support output pinning in Java OrtSession.run/OrtTrainingSession.run calls. I split it out from the rest of the work as it's useful by itself (e.g. to allow users to keep a single input tensor and rewrite it each time with new inputs rather than allocate a fresh one) and the other change will be much more involved so splitting it makes it easier to review. cc @yuslepukhin |
||
|---|---|---|
| .. | ||
| main | ||
| test | ||