-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Buffer refactoring to support batch over batch reliably #93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Buffer refactoring to support batch over batch reliably #93
Conversation
aaac27a
to
152b69c
Compare
152b69c
to
076619a
Compare
Do you think the |
Since you are asking, yes I think so. It makes everything pretty difficult to understand and maintain without adding any feature at the end. However, I'm afraid I don't really understand how this mechanism is working right now, so I'm not able to refactor this submodule by myself. It would be awesome to take advantage of the newly added flexibility of Batch to simplify the implement of this module. |
It is almost the same as the previous |
Ok I'll have a look at it. |
076619a
to
72f01e5
Compare
I think I should be able to handle it finally. I let you know. |
b66a836
to
e4888f8
Compare
ffc372f
to
184e26a
Compare
Doing |
54d8f2c
to
59ee0e7
Compare
59ee0e7
to
551fac2
Compare
Finally I will do this, since it is impossible to get a reliable behaviour using broadcasting (lower level nested Batch instances have no idea of the size of the top Batch, making it impossible to perform broadcast), and it was pretty hard to maintain. |
51b3027
to
6fea54d
Compare
6fea54d
to
3c4085a
Compare
@Trinkle23897 PR ready to be merged ! All tests passing successfully finally ! |
By the way, I found that in #92, the overhead of |
YEs, I'm on it ! |
@Trinkle23897 Can you check this branch ? #95 |
* Fix support of batch over batch for Buffer. * Do not use internal __dict__ attribute to store batch data since it breaks inheritance. * Various fixes. * Improve robustness of Batch/Buffer by avoiding direct attribute assignment. Buffer refactoring. * Add axis optional argument to Batch stack method. * Add item assignment to Batch class. * Fix list support for Buffer. * Convert list to np.array by default for efficiency. * Add missing unit test for Batch. Fix unit tests. * Batch item assignment is now robust to key order. * Do not use getattr/setattr explicity for simplicity. * More flexible __setitem__. * Fixes * Remove broacasting at Batch level since it is unreliable. * Forbid item assignement for inconsistent batches. * Implement broadcasting at Buffer level. * Add more unit test for Batch item assignment. Co-authored-by: Alexis Duburcq <alexis.duburcq@wandercraft.eu>
stack
methodnp.ndarray
for bothBatch
andBuffer
classesThis PR incidently fixes the support of deeply nested Batch over Batch for Buffers.