fbcode/spdl/tests/cuda/nvjpeg_decode_test.py#1355
fbcode/spdl/tests/cuda/nvjpeg_decode_test.py#1355meta-codesync[bot] wants to merge 1 commit intomainfrom
Conversation
Reviewed By: hanle11 Differential Revision: D101346101
JiwaniZakir
left a comment
There was a problem hiding this comment.
The type annotation on _test's data parameter looks incorrect — it's typed as str, but JPEG image data is binary, so it should almost be bytes. This is inconsistent with _is_all_zero, which is correctly annotated as arr: bytes. Since the whole point of adding # pyre-strict is to get accurate static analysis, a wrong annotation here undermines that goal and could suppress real type errors in callers. It's worth checking what get_sample actually returns to confirm, and then fixing _test's signature accordingly. Additionally, the declared return type torch.Tensor for _test should be verified against the actual return path in the full function body, since the diff only shows the signature change.
|
Hi @JiwaniZakir Thanks for the review. Indeed this one is incorrect. I forwarded the feedback to the author. |
Reviewed By: hanle11
Differential Revision: D101346101