Open londumas opened 8 months ago
The current algorithm can only optimize for a single batch (i.e. independent inputs). Therefore, the support for multiple batches will at best do the same as you are currently doing and may not give improved/optimized execution (although it may help with cleaner code). If this is of interest, I can look into including this within the library.
Thanks for the answer @masadcv,
although it may help with cleaner code
This is alread a good reason, what do you think ? If it can be used, here is my code BTW:
batch_size = image.shape[0]
dist_trans = torch.cat(
[
FastGeodis.generalised_geodesic2d(image[i : i + 1], image[i : i + 1], v=v, lamb=lamb, iter=iter)
for i in range(batch_size)
],
axis=0,
)
One more reason is to reduce memory footprint. Using concatenation incurs unnecessary copies.
ValueError: FastGeodis currently only supports single batch input.
when usingFastGeodis.generalised_geodesic2d, v=1.0e10, lamb=0.0, iter=1