imagej / imagej/imagej-tensorflow
Use ByteBuffers for all image types
- Dominant language
- Java
- Stars
- 26
- Forks
- 15
- PR merge metrics
- No merged PRs in 30d
Description
TensorFlow may use ByteBuffers directly for creating the tensors while other buffers are copied.
From the [Documentation of the Tensor class](https://www.tensorflow.org/api_docs/java/reference/org/tensorflow/Tensor):
__`create (long[] shape, FloatBuffer data)`:__
> Create a Float Tensor with data from the given buffer.
>
> Creates a Tensor with the given shape by copying elements from the buffer (starting from its current position) into the tensor. For example, if shape = {2,3} (which represents a 2x3 matrix) then the buffer must have 6 elements remaining, which will be consumed by this method.
__`create (Class type, long[] shape, ByteBuffer data)`:__
> Create a Tensor of any type with data from the given buffer.
>
> Creates a Tensor with the provided shape of any type where the tensor's data has been encoded into data as per the specification of the TensorFlow C API.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reading the linked Tensor class documentation and locating the code paths that create tensors for each image type. Compare how ByteBuffer and other buffer types are currently handled. Done means all image types use the ByteBuffer-based Tensor API consistently, with existing tensor creation behavior preserved.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- machine-learning
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100