-
Notifications
You must be signed in to change notification settings - Fork 15
Description
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.