Fix handling of empty layouts in ndd.Invocation#6304
Conversation
|
CI MESSAGE: [48791722]: BUILD STARTED |
Greptile SummaryThis PR fixes an inconsistency in Confidence Score: 5/5Safe to merge — narrow, well-tested fix with no breaking changes. All changes are P2 or lower. The core fix is a one-line change with clear intent, the type annotation is corrected, and new targeted tests cover both deferred and evaluated paths. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["Invocation.layout(result_index)"] --> B{_results is None?}
B -- Yes --> C{init_spec available?}
C -- Yes --> D["Call init_spec()\nRead OutputDesc layout"]
D --> E{layout is not None?}
E -- Yes --> F["Convert to str\nReturn None if '' else layout"]
E -- No --> G["self.run(_eval_context)"]
C -- No --> G
G --> H["layout = _results[result_index].layout()"]
B -- No --> H
H --> I["return layout or None\n('' → None)"]
Reviews (2): Last reviewed commit: "Fix annotation." | Re-trigger Greptile |
|
CI MESSAGE: [48791722]: BUILD PASSED |
Signed-off-by: Michal Zientkiewicz <michalz@nvidia.com>
Signed-off-by: Michal Zientkiewicz <michalz@nvidia.com>
10f1738 to
7e3af9b
Compare
Signed-off-by: Michal Zientkiewicz <michalz@nvidia.com>
|
CI MESSAGE: [49079846]: BUILD STARTED |
|
CI MESSAGE: [49079846]: BUILD PASSED |
| std::vector<float> rel_shape; | ||
| if (spec.TryGetRepeatedArgument(rel_shape, "rel_shape")) | ||
| return rel_shape.size(); | ||
| return std::nullopt; |
There was a problem hiding this comment.
This was a bit too pessimistic.
Category:
Bug fix (non-breaking change which fixes an issue)
Description:
This PR fixes a minor inconsistency in handling empty layouts. Empty layouts obtained from metadata were returned as
Nonebut as empty string if evaluation was required. NowNoneis returned across the board, consistent with the behavior of Tensor and Batch.Additional information:
Affected modules and functionalities:
Key points relevant for the review:
Tests:
Checklist
Documentation
DALI team only
Requirements
REQ IDs: N/A
JIRA TASK: N/A