Commit 77adf0b
EmptyPoseBody: zero-allocation reads + fix v0.1 frame count via BytesIOReader (#234)
* EmptyPoseBody: zero-allocation reads, fix v0.1 frame count via BytesIOReader
unpack_empty_tensor now returns a zero-stride broadcast view instead of
np.empty, keeping shape and dtype without allocating shape-sized memory.
Adding a shape test exposed a pre-existing bug: BytesIOReader.bytes_left()
only counted already-buffered bytes, so v0.1 files (which infer frame count
from bytes_left) read 0 frames through any BytesIOReader path (EmptyPoseBody,
start_frame/start_time on file objects). bytes_left() now reports the
stream's remaining bytes, matching BufferReader semantics, while
expect_to_read uses the new buffered_bytes_left() for chunk fetching.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* Comment the seek dance in BytesIOReader.bytes_left
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
---------
Co-authored-by: Amit Moryossef <amitmoryossef@Amits-MacBook-Pro.local>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>1 parent 7640301 commit 77adf0b
3 files changed
Lines changed: 43 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
| 95 | + | |
| 96 | + | |
96 | 97 | | |
97 | 98 | | |
98 | 99 | | |
| |||
220 | 221 | | |
221 | 222 | | |
222 | 223 | | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
223 | 235 | | |
224 | 236 | | |
225 | 237 | | |
| |||
230 | 242 | | |
231 | 243 | | |
232 | 244 | | |
233 | | - | |
234 | | - | |
| 245 | + | |
| 246 | + | |
235 | 247 | | |
236 | 248 | | |
237 | 249 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
78 | 89 | | |
79 | 90 | | |
80 | 91 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
323 | 324 | | |
324 | 325 | | |
325 | 326 | | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
326 | 343 | | |
327 | 344 | | |
328 | 345 | | |
| |||
0 commit comments