Add an argument to aloscene.batch_list, allowing to batch tensors with different children or properties with different values.
Closes #272
New feature 1 : Merge with different properties
f1 = Frame(torch.ones(3,10,10))
f2 = Frame(torch.ones(3,10,10))
f1.baseline = 0.5
f2.baseline = 1
f = aloscene.batch_list([f1, f2], intersection=True)
print(f.baseline)
Here, the baseline property has different values for different tensors. Therefore, the property baseline of the batched tensors has baseline set to None.
New feature 2 : Merge with different mergeable children
f1 = Frame(torch.ones(3,10,10))
f2 = Frame(torch.ones(3,10,10))
f1.append_disparity(Disparity(torch.ones(1,10,10)))
f = aloscene.batch_list([f1, f2], intersection=True)
print(f.disparity)
Only one of the two frames has a disparity child, therefore the batched tensor will have disparity set to None
Note: this will not drop unmergeable children, because by definition they allow that some tensors have None values for a child before merging
This pull request includes
[ ] Bug fix (non-breaking change which fixes an issue)
[x] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
Add an argument to
aloscene.batch_list
, allowing to batch tensors with different children or properties with different values. Closes #272New feature 1 : Merge with different properties
Here, the
baseline
property has different values for different tensors. Therefore, the property baseline of the batched tensors hasbaseline
set toNone
.New feature 2 : Merge with different mergeable children
Only one of the two frames has a disparity child, therefore the batched tensor will have
disparity
set toNone
Note: this will not drop unmergeable children, because by definition they allow that some tensors have
None
values for a child before mergingThis pull request includes