Unsqueeze
Adds a dimension of size 1 at the specified position.
Usage
val unsqueeze = Unsqueeze<FP32, Float>(ctx, dim = 0)
val batched = unsqueeze.apply(imageTensor) // [C, H, W] -> [1, C, H, W]Content copied to clipboard
Parameters
T
The tensor data type
V
The value type
ctx
The execution context for tensor operations
dim
The dimension to add