I am trying to stack tensors (all of the same shape) into one tensor. In python I believe you can simply do tf.stack([my, tensors])
I am struggling to stack x tensors of shape [1, 480, 640, 3] into one tensor of shape [x, 480, 640, 3].
I have atttempted using the Stack and TensorListStack classes:
try (EagerSession eagerSession = EagerSession.create())
{
Scope scope = new Scope(eagerSession);
Tensor<?> combinedTensor = Stack.create(scope, tensorsList);
}
Where tensorsList is an ArrayList<Tensors<?>>
create() requires Iterable<Operand> instead of ArrayList but I am unsure what this means.
Clearly I’m missing something but can’t figure it out…
Edit:
The tensors were originally ByteBuffers in BGR24 format