Skip to content

Use ByteBuffers for all image types #5

@HedgehogCode

Description

@HedgehogCode

TensorFlow may use ByteBuffers directly for creating the tensors while other buffers are copied.

From the Documentation of the Tensor class:
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<T> 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions